|
@ -632,14 +632,14 @@ class TCPRelay(object): |
|
|
if now - self._last_time > TIMEOUT_PRECISION: |
|
|
if now - self._last_time > TIMEOUT_PRECISION: |
|
|
self._sweep_timeout() |
|
|
self._sweep_timeout() |
|
|
self._last_time = now |
|
|
self._last_time = now |
|
|
if self._closed: |
|
|
if self._closed: |
|
|
if self._server_socket: |
|
|
if self._server_socket: |
|
|
self._eventloop.remove(self._server_socket) |
|
|
self._eventloop.remove(self._server_socket) |
|
|
self._server_socket.close() |
|
|
self._server_socket.close() |
|
|
self._server_socket = None |
|
|
self._server_socket = None |
|
|
logging.info('closed listen port %d', self._listen_port) |
|
|
logging.info('closed listen port %d', self._listen_port) |
|
|
if not self._fd_to_handlers: |
|
|
if not self._fd_to_handlers: |
|
|
self._eventloop.remove_handler(self._handle_events) |
|
|
self._eventloop.remove_handler(self._handle_events) |
|
|
|
|
|
|
|
|
def close(self, next_tick=False): |
|
|
def close(self, next_tick=False): |
|
|
self._closed = True |
|
|
self._closed = True |
|
|