現在ログインしているユーザー用の新しいソケットを非同期的に作成しています。サーバーは適切なタイミングでこのユーザーに通知し、別のビュー ページにいる可能性のあるユーザーにポップアップ メッセージが表示されます。次のようなソケットを作成しています。
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
socket.BeginReceive(buffer, 0, buffer.Length, 0,
new AsyncCallback(ReceiveNotification), socket);
private void ReceiveNotification(IAsyncResult ar)
{
Socket socket = (Socket)ar.AsyncState;
socket.EndReceive(ar);
//Need to perform notification stuff here
socket.Close();
}