socket 网络中断

node2:/root/test#cat t200.py 
# coding = utf-8
# -*- coding:utf-8 -*-
import socket
import time
import datetime
ip_port = ('192.168.137.3',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)
s.setsockopt( socket.SOL_SOCKET, socket.SO_SNDBUF, SEND_BUF_SIZE)
s.setsockopt( socket.SOL_SOCKET, socket.SO_RCVBUF, RECV_BUF_SIZE)
print 'alter----------------';
print s.getsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF)
print s.getsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF)
#s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 0)
s.b

上一篇:[功能优化] 包年包月实例和按量实例均已支持入门级变配企业级规格


下一篇:五、磁盘管理与文件系统