users@grizzly.java.net

Re: [Q] Passing around connection context such as remoteDestinationAddress and LocalSourceAddress

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 06 Mar 2008 10:39:10 -0500

Simon Trudeau wrote:
> How can I obtain a connection context inside a CallbackHandler?

((SocketChannel)SelectionKey.channel()).socket().getXXX

Thanks!

-- Jeanfrancois


>
> I would like to know, how can I obtain information about a connection?
> Most of the time, I will end up passing my connectorHandler around to
> read and to write, but I don't know how I can get information about the
> connection such as what's the local port I am connected from and what's
> the remote port and address I am connected to?
>
> Any ideas for me?
>
>
>
>
>
> Simon
>
>
>