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

Albert Brandl albert.brandl at weiermayer.com
Fri Nov 18 04:23:52 MST 2011


Hi!

We have a small heartbeat-system based on Twisted. The clients register
at the server and send some health information in regular intervals.
If the server does not get a lifesign from a client, this is registered
in a database. 

But sometimes, the clients have to go offline. In this case, I'd like 
them to send a message to the server that they will be gone for a while.
When a client goes offline, the twistd daemon for handling the heartbeats
is shut down.

What is the best way to do this in Twisted? The `clientConnectionLost`
method of the factory is only called after disconnecting, AFAICT.

Thanks & best regards,

-- 
Albert Brandl


​
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: </pipermail/twisted-python/attachments/20111118/3b0b2976/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 43835 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20111118/3b0b2976/attachment.jpe>


More information about the Twisted-Python mailing list