Zwischenstand Server- und Clientinitialisierung (Verbindung funktioniert noch nicht)
This commit is contained in:
parent
fbffbfe332
commit
7c4ae69817
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal 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>
|
15
mEIM-Praktikum_Webentwicklung/Aufg1_Sockets_Server.py
Normal file
15
mEIM-Praktikum_Webentwicklung/Aufg1_Sockets_Server.py
Normal file
@ -0,0 +1,15 @@
|
||||
import socket
|
||||
|
||||
myserver = socket.socket()
|
||||
hostname = myserver.gethostname()
|
||||
port = 12345
|
||||
myserver.bind((hostname, port))
|
||||
myserver.listen()
|
||||
|
||||
while True:
|
||||
(connection, addr) = myserver.accept()
|
||||
msg_from_client = myserver.recv(1024)
|
||||
in_capital_letters = msg_from_client.upper()
|
||||
connection.send(in_capital_letters.encode('utf-8'))
|
||||
connection.close()
|
||||
|
8
mEIM-Praktikum_Webentwicklung/Aufg2_Sockets_Client.py
Normal file
8
mEIM-Praktikum_Webentwicklung/Aufg2_Sockets_Client.py
Normal file
@ -0,0 +1,8 @@
|
||||
import socket
|
||||
|
||||
myclient = socket.socket()
|
||||
hostname = myserver.gethostname()
|
||||
port = 12345
|
||||
|
||||
myclient.connect((hostname, port))
|
||||
|
Loading…
x
Reference in New Issue
Block a user