解决socket.error: [Errno 98] Address already in use问题

解决socket.error: [Errno 98] Address already in use问题

1
https://www.jianshu.com/p/ec7fecc64165

用vi打开配置文件:

1
vi /etc/sysctl.conf

然后,在这个文件中,加入下面的几行内容:

1
2
3
4
net.ipv4.tcp_syncookies = 1    # 这一行配置文件里如果有就不用添加了  
net.ipv4.tcp_tw_reuse = 1  
net.ipv4.tcp_tw_recycle = 1  
net.ipv4.tcp_fin_timeout = 5

最后输入下面的命令,让内核参数生效:

1
/sbin/sysctl -p

Leave a Reply

Your email address will not be published. Required fields are marked *