
1
INET IPv4 99%
STREAM TCP - HOWTO
STREAM
1.1
IPC ( )
IPC
BSD Unix
INET
2
:
# create an INET, STREAMing socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# now connect to the web server on port 80 - the normal http port
s.connect(("www.python.org", 80))
:
# create an INET, STREAMing socket
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# bind the socket to a public host, and a well-known port
serversocket.bind((socket.gethostname(), 80))
# become a server socket
serversocket.listen(5)
socket.gethostname()
s.bind(('localhost', 80)) s.bind(('127.0.0.1', 80))
s.bind(('', 80))
HTTP, SNMP
4
listen 5
80 :
2
微信搜索公众号 "Python编程时光" ,回复 "pycharm" 获取免安装永久破解的专业版PyCharm
评论