1.3.3. Asynchronous Communication

Usually a client sends a request to the server and waits for the response. But in rare cases you may want to send a call without the need to check for a response, maybe because the result is of type void anyway. Then you invoke transmit() instead of call(). In this case the server will omit the response. Network problems, on the other hand, will be reported as usual.

[Caution]This is an ulxmlrpcpp extension

Servers from other implementations will always send a response. So you might receive garbage from the next call or maybe generate a lot of error messages on the remote server.

This extension offers another and probably more interesting working mode: asynchronous communication. The basic idea is to additionally install a server on the client side and use some sort of callback mechanism. This server should work in parallel with the client. See sections Section 1.6, “Multi-Processing XML-RPC” or Section 1.7, “Multithreaded HTTP server ” how this can be achieved in several ways.

The client then sends all asynchronous requests with transmit() to the server. The server on the other side processes the request and sends the response back to the client machine using an XML-RPC request with transmit() which calls the receiver function of the callback using the helper server.

Of course this enhanced technique works seaminglessly with the regular client/server approach.

ulxmlrpcpp also supports a multi-threaded working method for the client. This looks a bit similar to the above. The difference is, that each request creates a new thread to process the result. This is convenient but consumes rather much system resources.