Heikki Toivonen wrote: > John Nagle wrote: > >>def connect(self, addr): >> self.socket.connect(addr) >> self.addr = addr >> self.socket.settimeout(None) # Back to normal timeout (NEW) > > > I am not sure if this is always appropriate. In fact, doesn't this just > eliminate the timeout completely from this connection? > > In your case you could achieve what you want by calling > connection_object.socket.settimeout(4.0) method just before calling > connect, without needing to edit M2Crypto itself.
No, this actually works right. It seems that the default timeout controls the timeout on TCP connect, but puts the socket into non-blocking mode. So, if as soon as a TCP connection is opened, but before the SSL handshake starts, the socket timeout is set to None, then the socket returns to blocking mode before its first read. At least on Windows. More later on how this works on Linux. John Nagle -- http://mail.python.org/mailman/listinfo/python-list