学到了Python的网络编程,练习socket的使用,用它编写一个简单的服务监听程序。
用套接字监听TCP请求的程序
"""
2020-11-18 16:54:08+0800 chenxizhan new
"""
import os.path
import socket
print('pid:', os.getpid())
def task(host, port):
s = socket.socket()
print('监听:{}:{}'.format(host, port))
s.bind((host, port))
s.listen()
while True