Yes I did that. The connection IS made.

It appears that the IoSession reference returned by this code:

session = connectFuture.getSession();

Is different than the IoSession reference passed to this method:

public void sessionOpened(IoSession session) throws Exception {}

So... by setting my IoSession member variable to reference the
IoSession passed to sessionOpened, it works.

But shouldn't the IoSession returned by connectFuture.getSession();
and public void sessionOpened(IoSession session) throws Exception {}
be the same?

Kevin

On 7/25/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
Hi Kevin,

On 7/25/07, Kevin Smeltzer <[EMAIL PROTECTED]> wrote:
> I am having a problem connecting to my a Mina based server from a Mina
> based client application.
>
> The client appreas to connect using this code:
>
> session = connectFuture.getSession();
>
> The server log shows that the client connects and the client's
> sessionOpened(IoSession session) method is called:
>
>     public void sessionOpened(IoSession session) throws Exception {
>
>                 clientListener.doConnect( session );
>
>     }
>
> In the clientListener.doConnect method the connection is still valid
> and everything seems to be working perfectly:
>
> public void doConnect( IoSession session) {
>
>                 System.out.println(session);
>                 client.sendRequest ( new bgClientRequest ( request ) );
>
> }
>
> Then, in the sendRequest method, the session is null before I have
> even done any processing!
>
> What is happening?
> Does an IoSession member of my IoHandlerAdapter class get destroyed somehow?
> If so, why?

There might be some latency between the actual establishment of the
connection and notification to the future.  Please call future.join();
to ensure the notification is received.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to