Browse Source

erster commit

master
commit
775ce391d5
2 changed files with 25 additions and 0 deletions
  1. 14
    0
      client.py
  2. 11
    0
      server.py

+ 14
- 0
client.py View File

@@ -0,0 +1,14 @@
import socket

s = socket.socket()
host = socket.gethostname()
port = 12345
s.bind((host,port))
s.listen()

while True:
(connection, addr) = s.accept()
print("Verdindung von", addr)
msg= "Danke für ds vorbeischauen"
connection.send(msg.encode('utf-8'))
connection.close()

+ 11
- 0
server.py View File

@@ -0,0 +1,11 @@
import socket

s = socket.socket()
host = socket.gethostname()
port = 12345
#eingabe = "hello"

s.connect((host, port))
bytes = s.recv(1024)
print(bytes.decode('utf-8'))
s.close()

Loading…
Cancel
Save