users@websocket-spec.java.net

[jsr356-users] Re: Identifying a particular client

From: Stepan Kopriva <stepan.kopriva_at_oracle.com>
Date: Tue, 18 Dec 2012 10:49:44 +0100

Hi Raj,

currently in the version which is in trunk (not released yet) you can call Session.getUserProperties() and store any values here.

You need to put the Sessions representing the clients to some collection in onOpen method and then to iterate over it.

Alternatively, with tyrus versions that were released, you have to do this by yourself and put each Session instance to a map as a value with your identifier as a key.

Regards,

Stepan


On Dec 18, 2012, at 6:22 AM, <rajmahendra_at_gmail.com> wrote:

> (Sorry if i post again i tried to mail from gmail and i see my post is
> not reached here so i am composing from java.net)
>
> I am thinking of a way to identify one client from the session. My
> use-case is to identify each user using my key=value stored in each
> peer and find one particular person and send a message to him. Is it
> possible ?