Identify the client from the server side.

RCF support and general discussion.
Post Reply
jponnoua
Posts: 7
Joined: Thu Mar 08, 2012 1:46 pm

Identify the client from the server side.

Post 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.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Identify the client from the server side.

Post 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.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply