- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
Latest commit
16 lines (15 loc) · 392 Bytes
/
Copy pathserver.py
File metadata and controls
16 lines (15 loc) · 392 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
importsocket
port=1234
address="127.0.0.1"
BUF_SIZE=1024
#crete a socket object name "server"
server=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server.bind((address,port))
server.listen(5)
print("Listening...")
whileTrue:
con,addr=server.accept()
print("Connection Address is :",addr )
data=con.recv(BUF_SIZE)
print(data.decode("utf-8"))
con.send(data)