-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserv1.py
13 lines (12 loc) · 993 Bytes
/
serv1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python2
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('0.0.0.0',2222))
s.listen (10)
while True:
conn, addr = s.accept()
while True:
data=conn.recv(1024)
if data=='close':break
conn.send(data)
conn.close()