void OnSingletonConnection(ListenerConnectionModeReader modeReader) { ListenerSingletonConnectionReader singletonReader = new ListenerSingletonConnectionReader( modeReader.Connection, modeReader.GetConnectionDequeuedCallback(), transportType, modeReader.StreamPosition, modeReader.BufferOffset, modeReader.BufferSize, onConnectionClosed, onViaDecoded); lock (ThisLock) { if (isDisposed) { singletonReader.Dispose(); return; } connectionReaders.Add(singletonReader); } singletonReader.StartReading(modeReader.AccruedData, modeReader.GetRemainingTimeout()); }
void OnSingletonConnection(ListenerConnectionModeReader modeReader) { ListenerSingletonConnectionReader singletonReader = new ListenerSingletonConnectionReader( modeReader.Connection, modeReader.GetConnectionDequeuedCallback(), transportType, modeReader.StreamPosition, modeReader.BufferOffset, modeReader.BufferSize, onConnectionClosed, onViaDecoded); lock (ThisLock) { if (isDisposed) { singletonReader.Dispose(); return; } connectionReaders.Add(singletonReader); } singletonReader.StartReading(modeReader.AccruedData, modeReader.GetRemainingTimeout()); }