protected override void OnOpen(TimeSpan timeout) { this.announceOnlineAsyncResult = new AnnouncementDispatcherAsyncResult(this.announcementEndpoints, this.publishedEndpoints, this.discoveryMessageSequenceGenerator, true, null, null); if (this.State != CommunicationState.Opening) { // Fixes the ---- when OnAbort is called after OnOpen but before this.announceOnlineAsyncResult is created this.announceOnlineAsyncResult.Cancel(); } else { this.announceOnlineAsyncResult.Start(timeout, true); } AnnouncementDispatcherAsyncResult.End(this.announceOnlineAsyncResult); }
protected override void OnEndClose(IAsyncResult result) { AnnouncementDispatcherAsyncResult.End(result); }