__MagicPower
Do one thing and do it best!

导航

 
#!/usr/bin/env python 

import socket

def test_socket_timeout():
	s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
	print "Default socket timeout:%s"% s.gettimeout()
	s.settimeout(100)
	print "Current socket timeout:%s"% s.gettimeout()

if __name__ == '__main__':
	test_socket_timeout()

TEST:

Default socket timeout:None
Current socket timeout:100.0
[Finished in 0.1s]

posted on 2015-12-21 16:19  __MagicPower  阅读(180)  评论(0编辑  收藏  举报