[Twisted-Python] neverending connection
![](https://secure.gravatar.com/avatar/812cc4936ca92a5ad9073f521a32b7fb.jpg?s=120&d=mm&r=g)
Hello twisted.minions :) This is my first mail on tp-ml; hello! I'm currently working on twisted.ftp and it's about 30% into acceptable working state. To hack it you need to press enter twice :) But I've run into a known problem. I just noticed that TCPServer.loseConnection never trigs TCPServer.connectionLost. I think this is the famous never-ending-connection-bug, and I think the bug has its origin in selectable.doWrite. I'll here present my current findings with it. Note that doSelect will run its selectable.connectionLost() if selectable's doRead or doWrite returns anything non-zero. I'll take it step by step. A call to loseConnection, will set __reap Afterwards, __reap appears in doWrite which will write out its buffer and return CONNECTION_DONE doSelect terminates the connection Well, if we take a closer look at doWrite we find that it has several layers of if's before a CONNECTION_DONE is returned. Especially "if not self.unsent"! :/ Well, hope anyone finds this useful; and squash that horrible thing out. :)
participants (1)
-
grolgh