Esempio n. 1
0
        public ResolveResponse Resolve(ResolveCriteria criteria)
        {
            var req = new MessageContractsCD1.ResolveRequest()
            {
                Body = new ResolveCriteriaCD1(criteria)
            };

            Channel.BeginResolve(req, delegate(IAsyncResult result) {
                Channel.EndResolve(result);
            }, null);

            var timeout = InnerChannel.OperationTimeout < criteria.Duration ? InnerChannel.OperationTimeout : criteria.Duration;

            if (!reply_find_handle.WaitOne(timeout))
            {
                throw new TimeoutException();
            }
            try {
                var ir       = resolve_completed();
                var metadata = ir.Body.ToEndpointDiscoveryMetadata();
                var sequence = ir.MessageSequence.ToDiscoveryMessageSequence();
                return(new ResolveResponse(metadata, sequence));
            } finally {
                resolve_completed = null;
            }
        }
        public IAsyncResult BeginResolve(ResolveCriteria criteria, AsyncCallback callback, object state)
        {
            var req = new MessageContractsCD1.ResolveRequest()
            {
                Body = new ResolveCriteriaCD1(criteria)
            };

            return(Channel.BeginResolve(req, callback, state));
        }