protected override IAsyncResult BeginSendFindResponse( IDiscoveryResponseContract11 responseChannel, DiscoveryMessageSequence discoveryMessageSequence, EndpointDiscoveryMetadata matchingEndpoint, AsyncCallback callback, object state) { return(responseChannel.BeginProbeMatchOperation( ProbeMatchesMessage11.Create( discoveryMessageSequence, matchingEndpoint), callback, state)); }
public void EndProbeOperation(IAsyncResult result) { ProbeMatchesMessage11 response = base.Channel.EndProbeOperation(result); AsyncOperationContext context = (AsyncOperationContext)result.AsyncState; if ((response != null) && (response.ProbeMatches != null)) { this.responseReceiver.ProbeMatchOperation( context.OperationId, DiscoveryUtility.ToDiscoveryMessageSequenceOrNull(response.MessageSequence), DiscoveryUtility.ToEndpointDiscoveryMetadataCollection(response.ProbeMatches), true); } else { this.responseReceiver.PostFindCompletedAndRemove(context.OperationId, false, null); } }
public void ProbeOperation(FindCriteria findCriteria) { ProbeMessage11 request = new ProbeMessage11(); request.Probe = FindCriteria11.FromFindCriteria(findCriteria); ProbeMatchesMessage11 response = base.Channel.ProbeOperation(request); if ((response != null) && (response.ProbeMatches != null)) { this.responseReceiver.ProbeMatchOperation( OperationContext.Current.IncomingMessageHeaders.RelatesTo, DiscoveryUtility.ToDiscoveryMessageSequenceOrNull(response.MessageSequence), DiscoveryUtility.ToEndpointDiscoveryMetadataCollection(response.ProbeMatches), true); } else { this.responseReceiver.PostFindCompletedAndRemove(OperationContext.Current.IncomingMessageHeaders.RelatesTo, false, null); } }
public IAsyncResult BeginProbeMatchOperation(ProbeMatchesMessage11 response, AsyncCallback callback, object state) { Fx.Assert(response != null, "The response message cannot be null."); if ((response.MessageSequence != null) && (response.ProbeMatches != null)) { this.responseReceiver.ProbeMatchOperation( OperationContext.Current.IncomingMessageHeaders.RelatesTo, response.MessageSequence.ToDiscoveryMessageSequence(), DiscoveryUtility.ToEndpointDiscoveryMetadataCollection(response.ProbeMatches), false); } else { if (TD.DiscoveryMessageWithNullMessageSequenceIsEnabled() && response.MessageSequence == null) { TD.DiscoveryMessageWithNullMessageSequence( ProtocolStrings.TracingStrings.ProbeMatches, OperationContext.Current.IncomingMessageHeaders.MessageId.ToString()); } } return(new CompletedAsyncResult(callback, state)); }