public static void Recieved_on_Data(IAsyncResult rec) { SocketClient client = (SocketClient)rec.AsyncState; byte[] BytRec = client.GetRecievedData(rec); if (BytRec.Length < 1) { client.ReadOnlySocket.Close(); ClientsList.Remove(client); return; } foreach (SocketClient clientSend in ClientsList) { if (client != clientSend) { try { clientSend.ReadOnlySocket.Send(BytRec); } catch { clientSend.ReadOnlySocket.Close(); ClientsList.Remove(client); return; } } } client.RecieveCallSetup(); }
private static void AddListClient(Socket sockClient) { Newclient = new SocketClient(sockClient); ClientsList.Add(Newclient); Newclient.RecieveCallSetup(); }