示例#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.BackgroundThread(ReadSocketIntoRingBuffer, "SocketProducer_" + index);
        }