Netty WebSocketServer

"이희승 (Trustin Lee)" trustin at gmail.com
Thu Nov 11 03:54:03 EST 2010


Hi,

matthewencinas wrote:
> Hi,
> 
> I am using the code from the examples provided to create a WebSocketServer.
> I am able to connect a client and send a message via a client.
> 
> I am however, trying to create a chat application using the server. This
> means that a user should be able to send a message to another user.
> 
> How do i achieve this?
> 
> Some things i was trying to do in order to get the application built:
> * get a list of connected users

You can maintain the list of users in a Map, which is a member field of
your handler.

> * send a message to a user who is connected without them initiating a
> request

In the map, you need to store the reference to the Channels associated
with the users.

You might want to use ChannelGroup for example.

HTH

-- 
Trustin Lee - http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 290 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20101111/4688a03a/attachment-0001.bin 


More information about the netty-users mailing list