Skip to content

Commit

Permalink
log when closing port
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Sep 12, 2014
1 parent fdb3a36 commit e43520d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shadowsocks/tcprelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ def __init__(self, config, dns_resolver, is_local):
else:
listen_addr = config['server']
listen_port = config['server_port']
self._listen_port = listen_port

addrs = socket.getaddrinfo(listen_addr, listen_port, 0,
socket.SOCK_STREAM, socket.SOL_TCP)
Expand Down Expand Up @@ -636,6 +637,7 @@ def _handle_events(self, events):
self._eventloop.remove(self._server_socket)
self._server_socket.close()
self._server_socket = None
logging.info('closed listen port %d', self._listen_port)
if not self._fd_to_handlers:
self._eventloop.remove_handler(self._handle_events)

Expand Down

0 comments on commit e43520d

Please sign in to comment.