示例#1
0
 private void AddNewConnection(Socket sockClient)
 {
     // Program blocks on Accept() until a client connects.            
     ConnectedClient client = new ConnectedClient(sockClient);
     m_listClient.Add(client);            
     
     client.SetupRecieveCallback(this);
 }
示例#2
0
        private void AddNewConnection(Socket sockClient)
        {
            // Program blocks on Accept() until a client connects.
            ConnectedClient client = new ConnectedClient(sockClient);

            m_listClient.Add(client);

            client.SetupRecieveCallback(this);
        }
示例#3
0
        public void OnRecievedData(IAsyncResult ar)
        {
            ConnectedClient client = ar.AsyncState as ConnectedClient;

            byte [] aryRet = client.GetRecievedData(ar);

            if (aryRet.Length < 1)
            {
                client.Sock.Close();
                m_listClient.Remove(client);
                return;
            }
            else
            {
                m_DataReceiveHandler(this, null);
            }

            client.SetupRecieveCallback(this);
        }