Commit dbbe80b0 authored by Denis Bilenko's avatar Denis Bilenko

gevent.socket.socket: add 'closed' property

parent 6ccdea65
......@@ -320,6 +320,10 @@ class socket(object):
self.hub.cancel_wait(self._write_event, cancel_wait_ex)
self._sock = _closedsocket()
@property
def closed(self):
return isinstance(self._sock, _closedsocket)
def connect(self, address):
if self.timeout == 0.0:
return self._sock.connect(address)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment