public NotificationAsyncResult( GetNotificationsDelegate getNotifications, // Action<string> registerListenerWCF, // Action<string, Action<string>> registerListenerInProcess, MakeConnection poll, AsyncCallback callback, object state) { GetNotifications_External = getNotifications; // RegisterListenerForWCF_External = registerListenerWCF; // RegisterListenerInProcess_External = registerListenerInProcess; this.Poll = poll; m_callback = callback; this.AsyncState = state; GetNotifications(); }
public IAsyncResult BeginMakeConnect(MakeConnection poll, AsyncCallback callback, object state) { logger.Debug("BeginMakeConnect " + poll.Address + "."); NotificationAsyncResult notificationAR = new NotificationAsyncResult( GetNotificationsFromPublisher, //RegisterListenerWithPublisher, //RegisterListenerWithPublisher, poll, callback, state); lock (m_pendingNotifications) { if (m_pendingNotifications.ContainsKey(poll.Address)) { m_pendingNotifications.Remove(poll.Address); } m_pendingNotifications.Add(poll.Address, notificationAR); } return(notificationAR); }
public IAsyncResult BeginMakeConnect(MakeConnection poll, AsyncCallback callback, object state) { logger.Debug("BeginMakeConnect " + poll.Address + "."); NotificationAsyncResult notificationAR = new NotificationAsyncResult( GetNotificationsFromPublisher, //RegisterListenerWithPublisher, //RegisterListenerWithPublisher, poll, callback, state); lock (m_pendingNotifications) { if (m_pendingNotifications.ContainsKey(poll.Address)) { m_pendingNotifications.Remove(poll.Address); } m_pendingNotifications.Add(poll.Address, notificationAR); } return notificationAR; }