コード例 #1
0
 public DuplexConnectionPoolHelper(ClientFramingDuplexSessionChannel channel,
                                   ConnectionPool connectionPool, IConnectionInitiator connectionInitiator)
     : base(connectionPool, connectionInitiator, channel.Via)
 {
     _channel  = channel;
     _preamble = channel.CreatePreamble();
 }
 public ClientDuplexConnectionReader(ClientFramingDuplexSessionChannel channel, IConnection connection, ClientDuplexDecoder decoder, IConnectionOrientedTransportFactorySettings settings, MessageEncoder messageEncoder) : base(connection, null, 0, 0, null)
 {
     this.decoder        = decoder;
     this.maxBufferSize  = settings.MaxBufferSize;
     this.bufferManager  = settings.BufferManager;
     this.messageEncoder = messageEncoder;
     this.channel        = channel;
 }
コード例 #3
0
            public SendPreambleAsyncResult(ClientFramingDuplexSessionChannel channel, IConnection connection, ArraySegment <byte> preamble, bool flowIdentity, ref TimeoutHelper timeoutHelper, AsyncCallback callback, object state) : base(callback, state)
            {
                this.channel       = channel;
                this.timeoutHelper = timeoutHelper;
                this.connection    = connection;
                if (flowIdentity && !SecurityContext.IsWindowsIdentityFlowSuppressed())
                {
                    this.identityToImpersonate = WindowsIdentity.GetCurrent(true);
                }
                channel.decoder = new ClientDuplexDecoder(0L);
                IAsyncResult result = connection.BeginWrite(preamble.Array, preamble.Offset, preamble.Count, true, timeoutHelper.RemainingTime(), onWritePreamble, this);

                if (result.CompletedSynchronously && this.HandleWritePreamble(result))
                {
                    base.Complete(true);
                }
            }
コード例 #4
0
            public OpenAsyncResult(ClientFramingDuplexSessionChannel duplexChannel, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                IAsyncResult result;

                this.timeoutHelper = new TimeoutHelper(timeout);
                this.duplexChannel = duplexChannel;
                try
                {
                    result = duplexChannel.connectionPoolHelper.BeginEstablishConnection(this.timeoutHelper.RemainingTime(), onEstablishConnection, this);
                }
                catch (TimeoutException exception)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new TimeoutException(System.ServiceModel.SR.GetString("TimeoutOnOpen", new object[] { timeout }), exception));
                }
                if (result.CompletedSynchronously && this.HandleEstablishConnection(result))
                {
                    base.Complete(true);
                }
            }