init
This commit is contained in:
parent
17078b849a
commit
1cb2a8973e
13
client.py
Normal file
13
client.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import socket
|
||||||
|
s = socket.socket()
|
||||||
|
host = socket.gethostname()
|
||||||
|
port = 22445
|
||||||
|
|
||||||
|
|
||||||
|
s.connect((host, port))
|
||||||
|
message = input('eingabe: ')
|
||||||
|
#bytes = s.sendmsg(message.encode('utf-8'))
|
||||||
|
test = s.send(message.encode('utf-8'))
|
||||||
|
msg = s.recv(1024)
|
||||||
|
print (msg.decode('utf-8'))
|
||||||
|
s.close()
|
17
server.py
Normal file
17
server.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import socket
|
||||||
|
|
||||||
|
s = socket.socket()
|
||||||
|
host = socket.gethostname()
|
||||||
|
port = 22445
|
||||||
|
s.bind((host, port))
|
||||||
|
s.listen()
|
||||||
|
|
||||||
|
|
||||||
|
while True:
|
||||||
|
(connection, addr) = s.accept()
|
||||||
|
print('verbindung von ', addr)
|
||||||
|
bytes = connection.recv(1024)
|
||||||
|
msg = bytes.decode('utf-8')
|
||||||
|
msg = msg.upper()
|
||||||
|
connection.send(msg.encode('utf-8'))
|
||||||
|
connection.close()
|
Loading…
x
Reference in New Issue
Block a user