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); }
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); }