Browse Source

server

master
Mai Gillmann 4 years ago
parent
commit
97c7f944f5
2 changed files with 21 additions and 0 deletions
  1. 6
    0
      .idea/vcs.xml
  2. 15
    0
      demo_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>

+ 15
- 0
demo_server.py View File

@@ -0,0 +1,15 @@
import socket

s = socket.socket()
host = socket.gethostname()
port = 12346
s.bind((host, port))
print("Vor listen")
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