예제 #1
0
 def __init_socket(self, sock: socket) -> int:
     sock.setblocking(False)
     sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, self.buffer_size)
     sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.buffer_size)
     sock_fd = sock.detach()
     return sock_fd
예제 #2
0
 def _setupsocket(s: socket) -> None:
     s.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, True)
     s.setblocking(False)