Loading ...
Sorry, an error occurred while loading the content.

The communication of the server-side to the client-side

Expand Messages
  • xuerldx
    Lately,I use the JSON-RPC-Java to communicate between the client-side and the server-side in my project. I know,the principle of this RPC protocol is : the
    Message 1 of 2 , Apr 3, 2005
    • 0 Attachment
      Lately,I use the JSON-RPC-Java to communicate between the client-side
      and the server-side in my project. I know,the principle of this RPC
      protocol is : the client sends a request to the server,the server handle
      the request ,and then responses to this specified request; but now ,I
      want to do that ,if the server changed,I want the client know this
      change synchronous.
      I also thought about using the timer in the client to send request to
      the server periodically,but if there were a lot of big numbers waiting
      for send,the cost is great.So I don't know what should to do ?
    • Jan-Klaas Kollhof
      Unless you can open a socket connection from the client to the server which stays open, there is no way for the server to push the data as it is generated. You
      Message 2 of 2 , Apr 4, 2005
      • 0 Attachment
        Unless you can open a socket connection from the client to the server
        which stays open, there is no way for the server to push the data as
        it is generated. You will have to use polling with a timer, say every
        2 seconds you make a request to the server and the server sends the data.
        To lower the number of requests, you could have the server keep the
        connection open and wait for the client requestto timeout if there is
        no data to be sent. The client would know to just send another request
        after the. This way the client would get data pretty much the moment
        the server generates it. There is only a little lack when rerequesting.

        Jan
      Your message has been successfully submitted and would be delivered to recipients shortly.