[Twisted-Python] Another tcp.Client question

Itamar twisted at itamarst.org
Fri Aug 31 14:44:01 EDT 2001


OK, the following patch seems to solve the problem. It is based on the 
fact doWrite is set to equal doConnect - I assume that this patch 
implements what was intended in the first place.


Index: tcp.py
===================================================================
RCS file: /cvs/Twisted/twisted/internet/tcp.py,v
retrieving revision 1.16
diff -c -r1.16 tcp.py
*** tcp.py	2001/08/29 10:13:55	1.16
--- tcp.py	2001/08/31 18:46:49
***************
*** 159,168 ****
               self.socket.connect(self.addr)
           except socket.error, se:
               if se.args[0] in (EWOULDBLOCK, EALREADY, EINPROGRESS):
!                 pass
               else:
                   self.protocol.connectionFailed()
                   return CONNECTION_LOST
           # If I have reached this point without raising or returning, 
that means
           # that the socket is connected.
           del self.doWrite
--- 159,170 ----
               self.socket.connect(self.addr)
           except socket.error, se:
               if se.args[0] in (EWOULDBLOCK, EALREADY, EINPROGRESS):
!                 self.startWriting()
!                 return
               else:
                   self.protocol.connectionFailed()
                   return CONNECTION_LOST
+
           # If I have reached this point without raising or returning, 
that means
           # that the socket is connected.
           del self.doWrite







More information about the Twisted-Python mailing list