[Twisted-Python] Closing a connection?

Yun Mao maoy at cis.upenn.edu
Thu Aug 12 16:34:10 MDT 2004


self.transport.loseConnection()

Yun


On Thu, 12 Aug 2004, Britt Green wrote:

> I know this answer is obvious, but I can't seem to find it. How do I
> close a connection? I have this bit of code:
>
> class Echo(basic.LineReceiver):
>
>     def lineReceived(self, data):
>         "As soon as any data is received, write it back."
>
>         if data == "quit":
>             self.transport.write("Quit command received.\r\n")
>
> How do I kill the client's connection? I've checked the docs and
> Google, but couldn't find a thing on it. I know its something totally
> obvious that I'm overlooking though...
>
> Britt
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>




More information about the Twisted-Python mailing list