diff --git a/talk_client.py b/talk_client.py index 783229e..14b4f71 100644 --- a/talk_client.py +++ b/talk_client.py @@ -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) diff --git a/talk_server.py b/talk_server.py index 057ce57..82ff268 100644 --- a/talk_server.py +++ b/talk_server.py @@ -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)