Re: RPC Library? help-me
Posted: Mon May 22, 2017 4:42 am
Typically, you'd have the server generate a unique session id for the client. The first remote proc you'd call would be something like "startSession," which would return the session id. Then the rest of the remote procs, or most of them, will take that session id as the first argument.marcosmfilho wrote:I can not put generic ports for clients, the client port has to be the same as the server port to work, so I can not differentiate the clients.
This isn't really how RPC works, unfortunately. It's a request-response model, meaning the client always initiates communication. The server can't "call up" a client later to deliver a message, it can only respond to requests from clients when those requests are made (like the web).marcosmfilho wrote:The message should arrive instantaneously on client 2 without it having to make any calls
The usual solution to that is polling. Just have the client ask the server if there are any new messages for it a few times per second.