public RequestAsyncResult(Message message, TimeSpan timeout, SizedTcpRequestChannel channel, AsyncCallback callback, object state) : base(callback, state) { this.channel = channel; this.timeout = timeout; IAsyncResult sendResult = channel.BeginSendMessage(message, timeout, OnSend, this); if (sendResult.CompletedSynchronously) { this.CompleteSend(sendResult); } }
public ConnectAsyncResult(TimeSpan timeout, SizedTcpRequestChannel channel, AsyncCallback callback, object state) : base(callback, state) { // production code should use this timeout this.timeout = timeout; this.channel = channel; IAsyncResult dnsGetHostResult = Dns.BeginGetHostEntry(channel.Via.Host, OnDnsGetHost, this); if (!dnsGetHostResult.CompletedSynchronously) { return; } if (this.CompleteDnsGetHost(dnsGetHostResult)) { base.Complete(true); } }