RIOResizeRequestQueue function

The RIOResizeRequestQueue function resizes a request queue to be either larger or smaller for use with the Winsock registered I/O extensions.

Syntax

BOOL  RIOResizeRequestQueue(
  _In_ RIO_RQ RQ,
  _In_ DWORD  MaxOutstandingReceive,
  _In_ DWORD  MaxOutstandingSend
);

Parameters

  • RQ [in]
    A descriptor that identifies an existing registered I/O socket descriptor (request queue) to resize.

  • MaxOutstandingReceive [in]
    The maximum number of outstanding sends allowed on the socket. This value can be larger or smaller than the original number.

    This parameter is usually a small number for most applications.

  • MaxOutstandingSend [in]
    The maximum number of outstanding receives allowed on the socket. This value can be larger or smaller than the original number.

Return value

If no error occurs, the RIOResizeRequestQueue function returns TRUE. Otherwise, a value of FALSE is returned, and a specific error code can be retrieved by calling the WSAGetLastError function.

Return code Description
WSAEINVAL

An invalid parameter was passed to the function. This error is returned if the RQ parameter is not valid (RIO_INVALID_RQ, for example). This error is also returned if both the MaxOutstandingReceive and MaxOutstandingSend parameters are zero.

WSAENOBUFS

Sufficient memory could not be allocated. This error is returned if memory could not be allocated for the resized request queue.

WSAETOOMANYREFS

There are too many operations that still reference the request queue. Resizing of this request queue to be smaller is not possible at this time.

 

Remarks

The RIOResizeRequestQueue function resizes a request queue to be either larger or smaller. If the request queue already contains entries, those entries will be copied over to the new request queue.

A request queue has a required minimum size that is dependent on the current number of entries (number of sends and receives on the request queue). If an application calls the RIOResizeRequestQueue function and tries to set the queue too small for the number of existing entries, the call will fail and the queue will not be resized.

Note  The function pointer to the RIOResizeRequestQueue function must be obtained at run time by making a call to the WSAIoctl function with the SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER opcode specified. The input buffer passed to the WSAIoctl function must contain WSAID_MULTIPLE_RIO, a globally unique identifier (GUID) whose value identifies the Winsock registered I/O extension functions. On success, the output returned by the WSAIoctl function contains a pointer to the RIO_EXTENSION_FUNCTION_TABLE structure that contains pointers to the Winsock registered I/O extension functions. The SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER IOCTL is defined in the Ws2def.h header file. The WSAID_MULTIPLE_RIO GUID is defined in the Mswsock.h header file.

 

Windows Phone 8: This function is supported for Windows Phone Store apps on Windows Phone 8 and later.

Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

Thread Safety

If multiple threads attempt to access the same RIO_RQ using the RIODequeueCompletion or RIOResizeRequestQueue function, access must be coordinated by a critical section, slim reader writer lock , or similar mutual exclusion mechanism. If the completion queues are not shared, mutual exclusion is not required.

Requirements

Minimum supported client

Windows 8.1, Windows 8 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2012 [desktop apps | UWP apps]

Minimum supported phone

Windows Phone 8

Header

Mswsock.h

Library

Mswsock.lib

DLL

Mswsock.dll

See also

RIO_RQ

RIO_EXTENSION_FUNCTION_TABLE

RIOCreateCompletionQueue

RIODequeueCompletion

WSAIoctl