public ServerSessionPreambleConnectionReader(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TransportSettingsCallback transportSettingsCallback, ConnectionClosedCallback closedCallback, ServerSessionPreambleCallback callback) : base(connection, closedCallback)
 {
     this.rawConnection = connection;
     this.decoder = new ServerSessionDecoder(streamPosition, base.MaxViaSize, base.MaxContentTypeSize);
     this.offset = offset;
     this.size = size;
     this.transportSettingsCallback = transportSettingsCallback;
     this.callback = callback;
     base.ConnectionDequeuedCallback = connectionDequeuedCallback;
 }
Exemplo n.º 2
0
        private void OnDuplexConnection(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (this.onSessionPreambleKnown == null)
            {
                this.onSessionPreambleKnown = new ServerSessionPreambleCallback(this.OnSessionPreambleKnown);
            }
            ServerSessionPreambleConnectionReader item = new ServerSessionPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size, this.transportSettingsCallback, this.onConnectionClosed, this.onSessionPreambleKnown);

            lock (this.ThisLock)
            {
                if (this.isDisposed)
                {
                    item.Dispose();
                    return;
                }
                this.connectionReaders.Add(item);
            }
            item.StartReading(this.viaDelegate, timeout);
        }
        void OnDuplexConnection(IConnection connection, Action connectionDequeuedCallback,
                                long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (onSessionPreambleKnown == null)
            {
                onSessionPreambleKnown = OnSessionPreambleKnown;
            }
            ServerSessionPreambleConnectionReader sessionPreambleReader = new ServerSessionPreambleConnectionReader(
                connection, connectionDequeuedCallback, streamPosition, offset, size,
                transportSettingsCallback, onConnectionClosed, onSessionPreambleKnown);

            lock (ThisLock)
            {
                if (isDisposed)
                {
                    sessionPreambleReader.Dispose();
                    return;
                }

                connectionReaders.Add(sessionPreambleReader);
            }

            sessionPreambleReader.StartReading(viaDelegate, timeout);
        }
 private void OnDuplexConnection(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TimeSpan timeout)
 {
     if (this.onSessionPreambleKnown == null)
     {
         this.onSessionPreambleKnown = new ServerSessionPreambleCallback(this.OnSessionPreambleKnown);
     }
     ServerSessionPreambleConnectionReader item = new ServerSessionPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size, this.transportSettingsCallback, this.onConnectionClosed, this.onSessionPreambleKnown);
     lock (this.ThisLock)
     {
         if (this.isDisposed)
         {
             item.Dispose();
             return;
         }
         this.connectionReaders.Add(item);
     }
     item.StartReading(this.viaDelegate, timeout);
 }
        void OnDuplexConnection(IConnection connection, Action connectionDequeuedCallback,
            long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (onSessionPreambleKnown == null)
            {
                onSessionPreambleKnown = OnSessionPreambleKnown;
            }
            ServerSessionPreambleConnectionReader sessionPreambleReader = new ServerSessionPreambleConnectionReader(
                connection, connectionDequeuedCallback, streamPosition, offset, size,
                transportSettingsCallback, onConnectionClosed, onSessionPreambleKnown);
            lock (ThisLock)
            {
                if (isDisposed)
                {
                    sessionPreambleReader.Dispose();
                    return;
                }

                connectionReaders.Add(sessionPreambleReader);
            }

            sessionPreambleReader.StartReading(viaDelegate, timeout);
        }