Exemplo n.º 1
0
        public void StartServer(IPAddress address, int port)
        {
            if (_serverSocket != null)
            {
                _serverSocket.Stop();
            }
            _serverSocket = new TcpListener(address, port);
            _serverSocket.Start();
            _moduleLister.MessageForListener("serveur démarré");

            // démarre le thread qui attend que les clients se connectent
            Thread thread = new Thread(WaitForAClient);

            thread.Name = "écoute les connection";
            thread.Start();
        }
Exemplo n.º 2
0
 public void SendMessageToListener(IServerListener listener, String message)
 {
     Console.WriteLine("envoie au listener : " + message);
     Console.WriteLine(listener.ToString());
     listener.MessageForListener(message);
 }