Hi,
I am writting a Client-Server application with mina. I am having problem in
gracefully shutting down the client. the way i am trying to do is:
- The client sends a logout request to the server.
- The server does the clean up and closes the connection.
- The client is waiting for the connection to be closed by the server.
- As soon as the connection is closed the client does the cleanup and exit.
The first two steps are fine. But the client is not recieving close
notification, due to this the client is hanging.
The code is as under:
On server side when I recieve LOGOUT:
session.close();
On Client Side:
GenericRequest req = new
GenericRequest(Constants.REQ_LOGOUT, null);
WriteFuture future = session.write(req);
future.awaitUninterruptibly();
conHandler.shutdown();
pinger.shutDown();
System.out.println("Waiting to close::");
this.session.getCloseFuture().awaitUninterruptibly();
System.out.println("Closed ");
The client is hanging on
this.session.getCloseFuture().awaitUninterruptibly();
Please let me know what is the right way to gracefully shut down a client
application.
Thanx,
Saurabh
--
View this message in context:
http://www.nabble.com/How-to-gracefully-shutdown-a-connection-from-client-tp15189221s16868p15189221.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.