how to manage connections?

falconair shahbazc at gmail.com
Mon Nov 22 22:50:36 EST 2010


Yeah, I'll do something like that.  I thought there might be a 'netty way'
to do it.

Thanks

On Mon, Nov 22, 2010 at 1:37 AM, kirtimaan.mg [via Netty Forums and Mailing
Lists] <ml-node+5761740-1113726588-38325 at n2.nabble.com<ml-node%2B5761740-1113726588-38325 at n2.nabble.com>
> wrote:

>    You can create and manage an array of connections. In your main class
> you can create a static array and in your handler's connection/disconnection
> event, you can add / remove channel to that array (use synchronized).
>
> Thanks
>
>
>  *-------Original Message-------*
>
>  *From:* [hidden email]<http://user/SendEmail.jtp?type=node&node=5761740&i=0>
> *Date:* 11/22/2010 5:13:47 AM
> *To:* [hidden email]<http://user/SendEmail.jtp?type=node&node=5761740&i=1>
> *Subject:* how to manage connections?
>
> Say I have a simple server:
>
> final ServerChannelFactory cf = ...
> final ServerBootstrap server = new ServerBootstrap(cf);
> server.bind(...);
>
> How can I get a list of all clients currently connected (perhaps their
> remote address and the  time at which they first connected)?
>
> My specific protocol has a unique ID associated with each connection.  How
> can I get a connection by ID and, say, kill it?  How can I ensure the same
> ID is not used by multiple connections?
>
> In each of those cases, a data structure needs to be accessed both, inside
> and outside connection pipelines.  Should I just pass in a thread safe data
> structure to each of my handlers, which then update it with relevant
> information (their own ID for example)?  Is there a more standard way of
> doing this?
>
> Thanks
>
> ------------------------------
> View message @
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/how-to-manage-connections-tp5761250p5761250.html<http://netty-forums-and-mailing-lists.685743.n2.nabble.com/how-to-manage-connections-tp5761250p5761250.html?by-user=t>
> To start a new topic under Netty User Group, email [hidden email]<http://user/SendEmail.jtp?type=node&node=5761740&i=2>
> To unsubscribe from Netty User Group, click here<http://netty-forums-and-mailing-lists.685743.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=685700&code=a2lydGltYWFuLm1nQGdtYWlsLmNvbXw2ODU3MDB8MTA5NDc4NzUwMQ==&by-user=t>.
>
>
>     <http://www.incredimail.com/?id=606430&rui=131362166&sd=20101122>
>
> *stampa_girl_line_en.gif* (62K) Download Attachment<http://attachment/5761740/0/stampa_girl_line_en.gif>
>
>
> ------------------------------
>  View message @
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/how-to-manage-connections-tp5761250p5761740.html
> To unsubscribe from how to manage connections?, click here<http://netty-forums-and-mailing-lists.685743.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761250&code=c2hhaGJhemNAZ21haWwuY29tfDU3NjEyNTB8Nzc0OTk0ODIz>.
>
>

-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/how-to-manage-connections-tp5761250p5765378.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list