[Kamaelia] TCPClient: How to sense connection failure?

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sat Jan 12 04:22:43 EST 2008


Hendrik van Rooyen wrote:

> Not sure about Kamelia, but I have found that when a FIN comes
> along, a socket.recv() gives back an empty string, just like EOF
> on a file.

That Python socket interface can detect it I'm absolutely sure --
Twisted handles it.

I even pdb'ed Kamaelia and control flow ended at a different point
in case of connection closing -- but yielded control to the
scheduler immediately and never continued.
 
> Below is what I use - a sort of netstring, synced on a tilde, with
> human readable length implementation and escaping of tildes and
> the escape character.

Thank you (though I hope I won't have to mess with socket
functions ;) ).
 
> I hope the tabs survive the journey

Looks like they morphed to spaces.

Regards,


Björn

-- 
BOFH excuse #77:

Typo in the code




More information about the Python-list mailing list