Beispiel #1
0
            public virtual bool EndTryReceive(IAsyncResult result, out Message message)
            {
                DoneReceivingAsyncResult doneRecevingResult = result as DoneReceivingAsyncResult;

                if (doneRecevingResult != null)
                {
                    return(DoneReceivingAsyncResult.End(doneRecevingResult, out message));
                }

                return(ClientDuplexReceiveMessageAndVerifySecurityAsyncResult.End(result, out message));
            }
Beispiel #2
0
            public virtual IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state)
            {
                if (DoneReceivingInCurrentState())
                {
                    return(new DoneReceivingAsyncResult(callback, state));
                }

                ClientDuplexReceiveMessageAndVerifySecurityAsyncResult result =
                    new ClientDuplexReceiveMessageAndVerifySecurityAsyncResult(this, this.InnerDuplexChannel, timeout, callback, state);

                result.Start();
                return(result);
            }