Jump to content

Ports and threading model


brad
 Share

Recommended Posts

Hi, I have been using the Java API successfully for a while, but I have a few questions. Apologies if the information is available elsewhere, but I haven't really been able to find any real documentation.

 

Which port does the API communicate to your servers through? I'll be moving my app to new machine shortly and need to configure the firewall.

 

What is the threading model used? Specifically, for the following handlers:

- DetailsRequestHandler

- PageRequestHandler

- CommandReceivedHandler

- PageCommandReceivedHandler

 

Are they guaranteed to be called by a single thread only or do I need to handle my own synchronization or make them safe for reentry (note that I have a single object that implements all these interfaces)?

 

Finally, I use the android client app, and I get repeated "instance is offline" notifications on instance failure, instead of just one. I'm not sure if the notification delete function on the android app is not working, or if I'm receiving multiple notifications. I presume the latter. Is there any way to configure the API to only send a single notification?

 

Thanks,

Brad

Link to comment
Share on other sites

  • Staff

Hello,

 

The only port you have to allow out through your firewall is 443 for the following hosts ws0 ....ws19 .pulseway.com.

To answer your second question, each Handler is called on it's own thread... so you should handle your own synchronization.

Link to comment
Share on other sites

Hi Calin,

 

Many thanks for the quick response. To clarify, is the following correct?

 

- Each of these four handlers is called by an independent thread

- Two of more of the handlers may be executing concurrently

- Each handler will only be called by a single thread at a time

 

So the handlers need to safe with respect to any shared data structures, but don't need to be reentrant.

 

Thanks,

Brad

Link to comment
Share on other sites

  • Staff

Hi Brad,

 

True , except last one. If for example you click twice on a command (on the mobile device) and the handler for that command takes a long time to execute you might end up with the same handler called by 2 threads,

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...