The InetServerDequeue function retrieves an item to the
server's internal FIFO (first in, first out) queue. To dynamically
determine the size of the next item in the queue, you can call this
function twice. First, call the function with the lpvItemData
parameter as a NULL pointer, and the size of the item will be stored
in the unsigned integer value pointed to by the lpdwItemSize
parameter. Next, allocate that amount of memory, and call the
function again, passing the pointer to the newly allocated
memory.
If the bRemove parameter is non-zero, the item is removed
from the queue and the memory that was allocated for it is released.
If the bRemove parameter is zero, then a copy of the item data
is returned, but it is not removed from the queue. This allows an
application to peek at the next item in the queue without removing
it. The server queue functions are thread-safe and each update to the
queue is an atomic operation. This enables an application to easily
exchange information with other client sessions, or even other
servers.
To obtain the number of items in the server FIFO queue, use the
InetGetServerQueueCount function. To remove all items from the
server queue, use the InetClearServerQueue function.