Browse Source

fffff

master
Amad Colovic 5 years ago
commit
8f013416bf
3 changed files with 32 additions and 0 deletions
  1. 6
    0
      .idea/vcs.xml
  2. 12
    0
      client.py
  3. 14
    0
      server.py

+ 6
- 0
.idea/vcs.xml View File

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

+ 12
- 0
client.py View File

import socket

s = socket.socket()
host = socket.gethostname()
port = 4444

eingabe = input ("Bitte etwas eingeben:")

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

+ 14
- 0
server.py View File

import socket

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

while True:
(connection, addr) = s.accept()
print("Verbindung von ", addr)
msg = "Danke für das Vorbeischauen!"
connection.send(msg.encode("utf-8"))
connection.close()

Loading…
Cancel
Save