使用socket.setsockopt()和SO_SNDBUF:socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, ) 是要设置为Python的缓冲区大小。int。socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 8192) # Buffer size 8192