Browse Source

Version_1

master
Kevin Holzschuh 5 years ago
commit
cf004f2950
2 changed files with 38 additions and 0 deletions
  1. 19
    0
      Client.py
  2. 19
    0
      Server.py

+ 19
- 0
Client.py View File

@@ -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()

+ 19
- 0
Server.py View File

@@ -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()

Loading…
Cancel
Save