send file protocal
This commit is contained in:
11
test_tool.py
11
test_tool.py
@@ -6,10 +6,19 @@ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.bind(('127.0.0.1', 3966))
|
||||
s.listen(100)
|
||||
|
||||
id = '''post net msw/1.0
|
||||
id: miku
|
||||
from: test
|
||||
length: 0
|
||||
|
||||
'''
|
||||
|
||||
id = id.encode()
|
||||
|
||||
def process(conn, addr):
|
||||
conn.sendall(id)
|
||||
print('accept connection from', str(addr))
|
||||
while True:
|
||||
print('accept connection from', str(addr))
|
||||
data = conn.recv(4096)
|
||||
if not data:
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user