first commit

This commit is contained in:
2019-12-14 11:47:50 +08:00
commit 9924a30108
12 changed files with 336 additions and 0 deletions

19
test_tool.py Normal file
View File

@@ -0,0 +1,19 @@
import socket
import threading
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 3900))
s.listen(100)
def process(conn, addr):
print('accept connection from', str(addr))
data = conn.recv(4096)
data = data.decode()
print(data)
while True:
conn, addr = s.accept()
threading.Thread(target=process, args=(conn, addr)).start()