public static void AcceptCallback(IAsyncResult ar) { Socket socket = _connection.AcceptCallback(ar, ServerSocket); ClientSockets.Add(socket); socket.BeginReceive(Buffer, 0, BUFFER_SIZE, SocketFlags.None, ReceiveCallback, socket); Console.WriteLine("Client connected, waiting for request..."); ServerSocket.BeginAccept(AcceptCallback, null); }