@@ -0,0 +1,19 @@ | |||
import socket | |||
SOCKET = socket.socket() | |||
HOST = socket.gethostname() | |||
PORT = 45677 | |||
# Eingabe | |||
eingabe = input("Eingabe: ") | |||
# Verbindung zum Server | |||
SOCKET.connect((HOST, PORT)) | |||
SOCKET.send(eingabe.encode("utf-8")) | |||
SOCKET.close() |
@@ -0,0 +1,19 @@ | |||
import socket | |||
SOCKET = socket.socket() | |||
HOST = socket.gethostname() | |||
PORT = 45677 | |||
SOCKET.bind((HOST, PORT)) | |||
SOCKET.listen() | |||
(connection, addr) = SOCKET.accept() | |||
eingabe = connection.recv(1024) | |||
print(eingabe.decode) | |||
SOCKET.close() |