On Jul 27, 2006, at 3:49 PM, Frédéric Brégier wrote:
4) Close feature :
I was a bit surprise when I found the following situation.
Consider the server is making a loop to send about 20 messages (each of them
being a part of a file).
At the end of the sends (session.write()), I put a session.close() and then
a join() on the CloseFuture.
I make a trace of all messageSent, sessionClosed, ...
and I observed the following :
- 10 messageSent (message really sent),
- 1 sessionClosed appears
- and of course the 10 last messages to sent are never sent (since the
session is closed).

Put a callback on the last WriteFuture you get from writing, and in that, perform your close. That way it will close after sending the last message.

-pete


--
[EMAIL PROTECTED] - http://fotap.org/~osi



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to