20 lines
308 B
Python
20 lines
308 B
Python
import socket
|
|
|
|
s = socket.socket()
|
|
host = socket.gethostname()
|
|
port = 12345
|
|
s.bind((host, port))
|
|
s.listen()
|
|
|
|
while True:
|
|
(connection, addr) = s.accept()
|
|
|
|
msg = connection.recv(1024)
|
|
msgReturn = msg.decode('utf-8').upper()
|
|
connection.send(msgReturn.encode('utf-8'))
|
|
connection.close()
|
|
|
|
|
|
|
|
|