Does any one know if an XML-RPC server can send asynchronous events to a client? I mean, I'd like the server to continually send status updates to the client beyond the initial return value of the RPC.
So the scenario would go something like this. Client makes connection with server, server uses that connection to send client updates when changes have been made.
Any suggestion on the best way to implement this.
Thanks,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-06-26
This kind of communication is not in the nature of HTTP or any client/server communication (it is not in the request/response fashion). There are two ways to achieve "bilateral" communication:
a) periodically check state of server (pinging if "event" should be triggered)
b) add server capabilities to Your client, so real server is client for Your server. That way real server can call some trigger in Your client. But, if You need to have multiple clients, then things get a little bit complicated, and You end up by writing DCOM or CORBA...
Oh, yes, You could also issue some WaitUntilEvent RPC request in one thread that waits forever on response. That is third way. Fortunately, this lib is going to have multi-thread support soon, so this is maybe the easiest way to achieve events functionality...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does any one know if an XML-RPC server can send asynchronous events to a client? I mean, I'd like the server to continually send status updates to the client beyond the initial return value of the RPC.
So the scenario would go something like this. Client makes connection with server, server uses that connection to send client updates when changes have been made.
Any suggestion on the best way to implement this.
Thanks,
This kind of communication is not in the nature of HTTP or any client/server communication (it is not in the request/response fashion). There are two ways to achieve "bilateral" communication:
a) periodically check state of server (pinging if "event" should be triggered)
b) add server capabilities to Your client, so real server is client for Your server. That way real server can call some trigger in Your client. But, if You need to have multiple clients, then things get a little bit complicated, and You end up by writing DCOM or CORBA...
Oh, yes, You could also issue some WaitUntilEvent RPC request in one thread that waits forever on response. That is third way. Fortunately, this lib is going to have multi-thread support soon, so this is maybe the easiest way to achieve events functionality...