MCPcopy Create free account
hub / github.com/EasyIME/PIME / SocketWrapper

Class SocketWrapper

python/python3/tornado/test/ioloop_test.py:265–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 # Unfortunately, sockets don't support the .closed attribute for
264 # inspecting their close status, so we must use a wrapper.
265 class SocketWrapper(object):
266 def __init__(self, sockobj):
267 self.sockobj = sockobj
268 self.closed = False
269
270 def fileno(self):
271 return self.sockobj.fileno()
272
273 def close(self):
274 self.closed = True
275 self.sockobj.close()
276
277 sockobj, port = bind_unused_port()
278 socket_wrapper = SocketWrapper(sockobj)

Callers 1

Calls

no outgoing calls

Tested by 1