Need client to close the session ?

View: New views
2 Messages — Rating Filter:   Alert me  

Need client to close the session ?

by Allen Jiang-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,All,
   When I connection with login server,the connection type is short live connection, in server side ,I add the following code:

WriteFuture future =session.write(message);
future.addListener(IoFutureListener.CLOSE);

The above code didn't close the session until the message has been sent.

when the client have received the message , the session.isconnect() 's value is still true.  

At last,my question is this: need I close the session after I received message in short term connection.

Regards!
Allen

 

Re: Need client to close the session ?

by Emmanuel Lecharny-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> At last,my question is this: need I close the session after I received message in short term connection.
>  
Well, it's a best practice to close things when your are done with them...


--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


LightInTheBox - Buy quality products at wholesale price!