Page 1 of 1

Identify the client from the server side.

Posted: Thu Mar 29, 2012 2:01 pm
by jponnoua
Hello,

I have one function on the server side that needs to know a caller identifier. Depending of the client who is calling this function, the result will differ. Is there a way to identify the client, from a function located in the server side ?

By the way, is there a way to know all the clients connected to the server, from the server side ?

Best regards,

Julien.

Re: Identify the client from the server side.

Posted: Fri Apr 06, 2012 1:14 pm
by jarl
jponnoua wrote:
I have one function on the server side that needs to know a caller identifier. Depending of the client who is calling this function, the result will differ. Is there a way to identify the client, from a function located in the server side ?
When the client connects, you can have them pass a client-specific id to the server, and store that in the server session using RcfSession::setUserData(). You can subsequently retrieve it with RcfSession::getUserData().
jponnoua wrote:
By the way, is there a way to know all the clients connected to the server, from the server side ?
You can use RcfServer::enumerateSessions(), to iterate over all current server sessions.