chattle/client.py

27 lines
646 B
Python
Raw Normal View History

2021-09-30 01:21:18 +02:00
__author__ = "Kieran Osborne"
__version__ = "0.0.1"
__status__ = "Development"
if (__name__ == "__main__"):
import config
import socket as network
import message
def init() -> None:
address = (config.host, config.port)
print("Starting connection to", address)
with network.socket(network.AF_INET, network.SOCK_STREAM) as socket:
socket.setblocking(False)
socket.connect_ex(address)
while True:
message_body = input("Enter a message: ")
print("\n")
socket.send(message.serialize("Kayomn", message_body))
init()