Browse Source

letztes commit

master
parent
commit
b707eed9ce
3 changed files with 20 additions and 8 deletions
  1. 6
    0
      .idea/vcs.xml
  2. 11
    6
      client.py
  3. 3
    2
      server.py

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

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

+ 11
- 6
client.py View File

@@ -3,12 +3,17 @@ import socket
s = socket.socket()
host = socket.gethostname()
port = 12345
s.bind((host,port))
s.listen()


eingabe = input("gibt etwas ein")
print(eingabe)



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




+ 3
- 2
server.py View File

@@ -3,9 +3,10 @@ import socket
s = socket.socket()
host = socket.gethostname()
port = 12345
#eingabe = "hello"
s.bind((host,port))
s.listen()

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

Loading…
Cancel
Save