Beispiel #1
0
        public unsafe void Receive(RioBufferSegment *bufferSegment, int bufferSegmentId, bool flush)
        {
            var lockTaken = false;
            var spinlock  = new SpinLock();

            try
            {
                spinlock.Enter(ref lockTaken);

                var rioReceiveFlags = flush ? RIO_RECEIVE_FLAGS.NONE : RIO_RECEIVE_FLAGS.DEFER;

                rioReceiveFlags |= RIO_RECEIVE_FLAGS.DONT_NOTIFY;

                if (!WinSock.Extensions.Receive(_handle, bufferSegment->GetRioBufferDescriptor(), 1, rioReceiveFlags, bufferSegmentId))
                {
                    WinSock.ThrowLastWsaError();
                }
            }
            finally
            {
                if (lockTaken)
                {
                    spinlock.Exit();
                }
            }
        }
Beispiel #2
0
        public unsafe void Receive(RioBufferSegment *bufferSegment, int bufferSegmentId, bool flush)
        {
            var rioSendFlags = flush ? RIO_RECEIVE_FLAGS.NONE : RIO_RECEIVE_FLAGS.DEFER;

            if (!WinSock.Extensions.Receive(_handle, bufferSegment->GetRioBufferDescriptor(), 1, rioSendFlags, bufferSegmentId))
            {
                WinSock.ThrowLastWsaError();
            }
        }