(self, sock)
| 33 | """ |
| 34 | |
| 35 | def __init__(self, sock): |
| 36 | self._sock = sock |
| 37 | self._ioloop = ioloop.IOLoop.current() |
| 38 | self._sock.setblocking(0) |
| 39 | self._pending_write = [] |
| 40 | self._signal_close = False |
| 41 | |
| 42 | def _event_handler(_, events): |
| 43 | self._event_handler(events) |
| 44 | |
| 45 | self._ioloop.add_handler( |
| 46 | self._sock.fileno(), _event_handler, self._ioloop.READ | self._ioloop.ERROR |
| 47 | ) |
| 48 | |
| 49 | def signal_close(self): |
| 50 | """Signal the handler to close. |