public void StartListening() { while (true) { var message = _protocolReader.Receive(_serverSocket); //todo //instantiate class } }
public void Start(IPEndPoint endpoint) { var serverSocket = new TcpListener(endpoint); serverSocket.Start(); Console.WriteLine(" >> " + "Server Started"); while (true) { var socket = _listener.WaitForClientToConnect(serverSocket); var message = _protocolReader.Receive(socket); _protocolOrchestrator.Process(socket, message); _publisher.PublishEventToAll(); } }