Skip to content

Commit

Permalink
如果採用,此提交將完成單向傳送訊息
Browse files Browse the repository at this point in the history
修改項目:
  • Loading branch information
timmy61109 committed Aug 25, 2019
1 parent 6c0004e commit 575c3f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 8 additions & 3 deletions talk_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
# coding = UTF-8
from Module.Communication import tcp

server_host = str(input("ServerHost:"))
server_port = int(input("ServerPort:"))

tcp = tcp()
server_host = str(input("Server Host:"))
server_port = int(input("Server Port:"))
while True:
message = str(input("Key Your Message:"))
tcp.client(Host=server_host, Port=server_port, message=message)
if message == "None":
print("exit")
else:
tcp.client(Host=server_host, Port=server_port, message=message)
print(message)
8 changes: 6 additions & 2 deletions talk_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# coding = UTF-8
from Module.Communication import tcp

server_host, server_port = "", 50000
tcp = tcp()
server_host, server_port = "0.0.0.0", 5000
data = tcp.server(Host=server_host, Port=server_port)
while True:
message = next(data)
print(message)
if message == "None":
break
else:
print(message)

0 comments on commit 575c3f6

Please sign in to comment.