Ejemplo n.º 1
0
        void OnDuplexConnection(ListenerConnectionModeReader modeReader)
        {
            ListenerSessionConnectionReader sessionReader = new ListenerSessionConnectionReader(
                modeReader.Connection, modeReader.GetConnectionDequeuedCallback(),
                transportType, modeReader.StreamPosition,
                modeReader.BufferOffset, modeReader.BufferSize,
                onConnectionClosed, onViaDecoded);

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

                connectionReaders.Add(sessionReader);
            }
            sessionReader.StartReading(modeReader.AccruedData, modeReader.GetRemainingTimeout());
        }
        void OnDuplexConnection(ListenerConnectionModeReader modeReader)
        {
            ListenerSessionConnectionReader sessionReader = new ListenerSessionConnectionReader(
                modeReader.Connection, modeReader.GetConnectionDequeuedCallback(), 
                transportType, modeReader.StreamPosition,
                modeReader.BufferOffset, modeReader.BufferSize,
                onConnectionClosed, onViaDecoded);

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

                connectionReaders.Add(sessionReader);
            }
            sessionReader.StartReading(modeReader.AccruedData, modeReader.GetRemainingTimeout());
        }