send file protocal

This commit is contained in:
2019-12-18 21:44:00 +08:00
parent 2ccadc74c1
commit 9243c407a1
5 changed files with 115 additions and 40 deletions

View File

@@ -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()