Ejemplo n.º 1
0
        private void DoClientConnected(IAsyncResult result)
        {
            TcpClient newClient = m_listener.EndAcceptTcpClient(result);

            if (newClient != null)
            {
                m_worker.ReportProgress(0, "Client connected from " + newClient.Client.LocalEndPoint.ToString());

                ClientConnection newClientConnection                = new ClientConnection(newClient);
                newClientConnection.ClientConnectionDisconnected    += new ClientConnectionDisconnectedHandler(ClientConnectionDisconnected);
                newClientConnection.ReportAdded                     +=new ClientReportHandler(ClientReportAdded);

                m_clientsToAdd.Enqueue(newClientConnection);
            }

            m_listener.BeginAcceptTcpClient(new AsyncCallback(DoClientConnected), null);
        }
Ejemplo n.º 2
0
 private void ClientReportAdded(ClientConnection client, String report)
 {
     m_worker.ReportProgress(0, report);
 }
Ejemplo n.º 3
0
 void m_server_ClientDisconnected(ClientConnection connection)
 {
 }
Ejemplo n.º 4
0
 private void ClientConnectionDisconnected(ClientConnection connection)
 {
     m_worker.ReportProgress(0, "Client Disconnected from " + connection.TcpClient.Client.LocalEndPoint);
     m_clientsToRemove.Enqueue(connection);
 }
Ejemplo n.º 5
0
 void TCPServer_ClientDisconnected(ClientConnection connection)
 {
     OnPropertyChanged("NumClients");
 }