node2:/root#sysctl -p | grep syn
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_syn_retries = 5
node1:/root/test#cat t200.py
# coding = utf-8
# -*- coding:utf-8 -*-
import socket
import time
import datetime
ip_port = ('192.168.137.2',8080)
BUFSIZE = 9000
SEND_BUF_SIZE = 200
RECV_BUF_SIZE = 100
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)#创建套接字
print("Buffer size [Before]: %d" % s.getsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF))
print("Buffer size [Before]: %d" % s.getsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF))
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)