Browse Source

Gesteuerter Verbindungsabbau (hostname geändert)

master
Nadege 4 years ago
parent
commit
89d83fe213
2 changed files with 2 additions and 3 deletions
  1. 1
    2
      client.py
  2. 1
    1
      server.py

+ 1
- 2
client.py View File

@@ -2,7 +2,7 @@ import socket


s = socket.socket()
host = socket.gethostname()
host = socket.gethostbyname('localhost')
port = 22225

s.connect((host, port))
@@ -18,5 +18,4 @@ while message != 'STOP':
bytes = s.recv(4096)
print(bytes.decode('utf-8'))
else:
print(message)
s.close()

+ 1
- 1
server.py View File

@@ -1,7 +1,7 @@
import socket

s = socket.socket()
host = socket.gethostname()
host = socket.gethostbyname('localhost')
port = 22225
s.bind((host, port))
s.listen()

Loading…
Cancel
Save