client and server modified
This commit is contained in:
parent
b470885871
commit
a67dfb7314
@ -1,7 +1,7 @@
|
||||
import socket
|
||||
s= socket.socket()
|
||||
host=socket.gethostname()
|
||||
port= 1345
|
||||
port= 13345
|
||||
s.connect((host , port))
|
||||
msg = input('geben sie was ein: ')
|
||||
bytes= s.send(msg.encode('utf-8'))
|
||||
|
@ -1,15 +1,15 @@
|
||||
import socket
|
||||
s = socket.socket()
|
||||
host = socket.gethostname()
|
||||
port = 1345
|
||||
port = 13345
|
||||
s.bind((host , port))
|
||||
s.listen()
|
||||
while True:
|
||||
(connection, addr )= s.accept()
|
||||
print('verbindung von', addr)
|
||||
msg= 'Danke für das vorbeischauen!'
|
||||
serge= s.recv(1024)
|
||||
message = serge.decode('utf-8')
|
||||
bytes= connection.recv(1024)
|
||||
message = bytes.decode('utf-8')
|
||||
sendmessage= message.upper()
|
||||
connection.send(sendmessage.encode('utf-8'))
|
||||
connection.close()
|
Loading…
x
Reference in New Issue
Block a user