On Mon, 26 Jan 2009 17:07:23 +0100, "Boeuf, Jean-Francois"
<jean-francois.bo...@eads.com> wrote:
[snip]
I'm Ok with that but it is no more than test sample code. The server does
write periodically the connection but doesn't send "<strong>Connection
closed because of server shutdown</strong>" whereas the onStop method is
correctly called!
Jean-François
This is probably because the reactor stops before the bytes are actually
sent. You may need to delay reactor shutdown until you know the bytes
have been sent. This may mean waiting for the connections to close or
it may mean waiting for a timeout to expire or it may mean something
else - it depends on which precise behavior you want.
"before" "shutdown" hooks can return a Deferred. The shutdown process
will pause until that Deferred fires. This lets you make the reactor
wait for whatever extra events you want it to wait for.
Jean-Paul
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python