[Twisted-Python] loseConnection() in BaseClient

Itamar Shtull-Trauring itamar at itamarst.org
Fri Sep 12 22:13:40 EDT 2003


On Tue, 9 Sep 2003 22:22:53 -0400 (EDT)
Yun Mao <maoy at cis.upenn.edu> wrote:

> Hi, I noticed that as a TCP client, the loseConnection() is inherited,
> and without a reason argument. Why this is different from the
> TCPServer, where a default reason argument is ConnectionDone?  Given
> such info, how to let a TCP client protocol in connectionLost() detect
> it's due to a network failure or a active close connection?

It's there for a different reason, and the client connection will in
fact get the reason it was disconnected. Hopefully there is even a test
for this.

-- 
Itamar Shtull-Trauring    http://itamarst.org/
Available for Python & Twisted consulting




More information about the Twisted-Python mailing list