diff --git a/Student/Server.py b/Student/Server.py index 1129cdd681b2cd7977fc3473bcb14b93da07ace0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/Student/Server.py +++ b/Student/Server.py @@ -1,45 +0,0 @@ -import socket - - - -FILE = 'message.txt' - -class Socket: - - def __init__(self): - - self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.socket.bind(('0.0.0.0', 25566)) - - self.message = "" - - - def readMessage(self): - with open(FILE, 'r') as file: - self.message = file.read() - - def start(self): - self.socket.listen(1) - - while True: - - client_socket, client_address = self.socket.accept() - - # Grab the new message from the file - readMessage() - - if self.message == '': - client_socket.close() - else: - # Send the message to the client (teacher) - client_socket.send(self.message.encode('UTF-8')) - - # Wait for the pong - response = client_socket.recv(1024).decode('UTF-8') - - if response == "Ok": - self.message = "" - client_socket.close() - - - \ No newline at end of file