コード例 #1
0
        public static void Receive(SafeRioRequestQueueHandle queue, IntPtr buffers, int bufferCount, uint flags, IntPtr requestContext)
        {
            Debug.Assert(!queue.IsInvalid);

            if (!s_rioReceive(queue, buffers, bufferCount, flags, requestContext))
            {
                throw new SocketException();
            }
        }
コード例 #2
0
        public RegisteredSocket(RegisteredMultiplexer multiplexer, Socket socket)
        {
            lock (multiplexer.SafeHandle)
            {
                _requestQueue = Interop.Rio.CreateRequestQueue(socket.SafeHandle, multiplexer.SafeHandle, IntPtr.Zero, 1, 1, 1, 1);
            }

            _socket = socket;
        }
コード例 #3
0
        public static SafeRioRequestQueueHandle CreateRequestQueue(SafeSocketHandle socket, SafeRioCompletionQueueHandle completionQueue, IntPtr context, uint maxOutstandingReceive, uint maxReceiveDataBuffers, uint maxOutstandingSend, uint maxSendDataBuffers)
        {
            Debug.Assert(!socket.IsInvalid);
            Debug.Assert(!completionQueue.IsInvalid);

            SafeRioRequestQueueHandle queue = s_rioCreateRequestQueue(socket, maxOutstandingReceive, maxReceiveDataBuffers, maxOutstandingSend, maxSendDataBuffers, completionQueue, completionQueue, context);

            if (queue.IsInvalid)
            {
                throw new SocketException();
            }

            queue.SetDependencies(socket, completionQueue);
            return(queue);
        }