예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RIOBufferPool" /> class.
        /// </summary>
        private RIOBufferPool(IntPtr buffer, UInt32 bufferLength, IntPtr bufferId, UInt32 bufferSegmentLength, UInt32 bufferSegmentsCount)
        {
            this.buffer = buffer;

            this.bufferLength = bufferLength;

            this.bufferId = bufferId;

            // initialize available segments collection
            availableSegments = new ConcurrentQueue <Int32>();

            // initialize collection of the buffer segments
            segments = new RIO_BUF[bufferSegmentsCount];

            var offset = 0u;

            // initialize items of the collection
            for (var segmentIndex = 0; segmentIndex < bufferSegmentsCount; segmentIndex++)
            {
                // initialize item
                segments[segmentIndex] = new RIO_BUF
                {
                    BufferId = bufferId,
                    Offset   = offset,
                    Length   = bufferSegmentLength
                };

                // add id of the segment into the collection of the available segments
                availableSegments.Enqueue(segmentIndex);

                // increment offset
                offset += bufferSegmentLength;
            }
        }
예제 #2
0
 public BOOL Send([In] RIO_RQ SocketQueue, [In] ref RIO_BUF pData, [In] DWORD DataBufferCount, [In] DWORD Flags, [In] PVOID RequestContext) => send(SocketQueue, ref pData, DataBufferCount, Flags, RequestContext);
예제 #3
0
 public BOOL Receive([In] RIO_RQ SocketQueue, [In] ref RIO_BUF pData, [In] ULONG DataBufferCount, [In] DWORD Flags, [In] PVOID RequestContext) => receive(SocketQueue, ref pData, DataBufferCount, Flags, RequestContext);