예제 #1
0
        public SocketConsumer(Socket socket, ByteRingBuffer ringBuffer,
                              CancellationToken cancellationToken, int index)
        {
            _socket            = socket;
            _ringBuffer        = ringBuffer;
            _cancellationToken = cancellationToken;

            ThreadFactory.CreateBackgroundThread(WriteSocketFromRingBuffer, "SocketConsumer_" + index);
        }
예제 #2
0
        public SocketProducer(Socket socket, ByteRingBuffer ringBuffer,
                              CancellationToken cancellationToken, int index)
        {
            _socket            = socket;
            _ringBuffer        = ringBuffer;
            _cancellationToken = cancellationToken;

            ThreadFactory.CreateBackgroundThread(ReadSocketIntoRingBuffer, "SocketProducer_" + index);
        }