[Twisted-Python] Sending a "good-bye message" before closing a connection

Albert Brandl albert.brandl at weiermayer.com
Wed Nov 23 05:13:03 EST 2011


Hi!

On Fri, Nov 18, 2011 at 08:31:18AM -0500, Itamar Turner-Trauring wrote:
> Presumably there is a method somewhere that decides to close the
> connection down:
> 
>    def timeToShutdown(self):
>        self.transport.loseConnection()

Actually, I hoped that I'd find such a method in the framework. When the
twistd daemon is shut down, it has to close all connections, and it would
have been nice if there were a hook that could be overridden.

But AFAICT, the respective code is buried inside the BaseConnector class,
and I'd rather leave it alone :-).

Anyway - it should be possible to send some kind of message to the daemon
in the init script before shutting it down.

Thanks & best regards,
-- 
Albert Brandl | Weiermayer Solutions GmbH


​
A-4813 Altmünster - Abteistraße 12 - web: www.weiermayer.com - phone: +43761287677 - fax: +43761220356 - mobile: +436642442777

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20111123/a4fa37d2/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 43835 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20111123/a4fa37d2/attachment-0001.jpeg 


More information about the Twisted-Python mailing list