Communication Models
The Iris server allows both the synchronous and asynchronous communication models using the command classes deployed on the server and following these conventions:
  • If a command method does not return void the client call will serialize the parameters, wait for the server response, deserialize the response and then continue. These methods are used to implement synchronous communication.
  • If a command method returns void the client call will serialize the parameters and return immediately. Asynchronous communication is implemented using methods returning void. If a command method would naturally return void in a local call scenario add a dummy return (example int) to force a synchronous call.

It is also possible for the server code to notify the client through client callbacks as presented in a previous chapter. All client invocations are asynchronous and the callback methods must return void.

In our example the publishing methods are asynchronous both in the IPublish interface and in the IUploader session command interface . Also the subscribe/unsubscribe methods are asynchronous. The message request methods return data and they are synchronous.