Browse Source

v2

master
Tu Quyen Tran Ngoc 5 years ago
parent
commit
dd72d45aef
3 changed files with 16 additions and 5 deletions
  1. 6
    0
      .idea/vcs.xml
  2. 3
    2
      clie_file.py
  3. 7
    3
      serv_file.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>

+ 3
- 2
clie_file.py View File

@@ -5,9 +5,10 @@ eingabe = input("Bitte etwas eingeben: ")
s = socket.socket()
host = socket.gethostname()
port = 12345

s.connect((host, port))

s.send(eingabe.encode('utf-8'))

msgRes = s.recv(1024)
print(msgRes.decode('utf-8'))

s.close()

+ 7
- 3
serv_file.py View File

@@ -9,7 +9,11 @@ s.listen()
while True:
(connection, addr) = s.accept()

bytes = s.recv(1024)
print(bytes.decode('utf-8'))
msg = connection.recv(1024)
msgReturn = msg.decode('utf-8').upper()
connection.send(msgReturn.encode('utf-8'))
connection.close()




connection.close()

Loading…
Cancel
Save