Browse Source

increase UDP buffer

akkariiin/dev
AkaneAkaza 7 years ago
parent
commit
063ce5d0ef
  1. 2
      shadowsocks/udprelay.py

2
shadowsocks/udprelay.py

@ -213,6 +213,8 @@ class UDPRelay(object):
server_socket = socket.socket(af, socktype, proto) server_socket = socket.socket(af, socktype, proto)
server_socket.bind((self._listen_addr, self._listen_port)) server_socket.bind((self._listen_addr, self._listen_port))
server_socket.setblocking(False) server_socket.setblocking(False)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024 * 1024)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1024 * 1024)
self._server_socket = server_socket self._server_socket = server_socket
self._stat_callback = stat_callback self._stat_callback = stat_callback

Loading…
Cancel
Save