[Twisted-Python] how to abort a Protocol connection

Folks, I have a usage case where the server need to abort a client TCP connection (implemented by Protocol) immediately. However, the normal Protocol.transport.loseConnection() will try to send pending data to the client first before close the connection. Currently I used an ugly hack to work around it, where I set Protocol.transport._writeDisconnected=True before call Protocol.transport.loseConnection() , which can fool the loseConnection to give up writing pending data. But I think there should be some more elegant way to do it. Any idea? Regards. Weikai Xie

On 26 Sep, 06:23 am, xieweikai@gmail.com wrote:
Unfortunately the best answer I have is a reference to an open ticket: http://twistedmatrix.com/trac/ticket/78 The feature you want seems to be largely implemented in a branch associated with that ticket, but seems to be blocked by some Windows/SSL issues. Jean-Paul

On 26 Sep, 06:23 am, xieweikai@gmail.com wrote:
Unfortunately the best answer I have is a reference to an open ticket: http://twistedmatrix.com/trac/ticket/78 The feature you want seems to be largely implemented in a branch associated with that ticket, but seems to be blocked by some Windows/SSL issues. Jean-Paul
participants (2)
-
exarkun@twistedmatrix.com
-
Weikai Xie