Platform SDK: DirectX

DirectPlay4.GetMessageQueue

The DirectPlay4.GetMessageQueue method retrieves information about the send or receive queue for a local player. If there is more than one player in a session on a single machine, the data returned is valid for all those players combined.

object.GetMessageQueue(from As Long, _
    to As Long, _
    flags As CONST_DPMESSAGEQUEUEFLAGS, _
    nMessage As Long, _
    nBytes As Long)

Parameters

object
Object expression that resolves to a DirectPlay4 object.
from
ID of the player sending the messages whose queue status is desired. Zero returns information about all sent messages. If to is also specified, only information about messages that are both from player from and to player to is returned.
to
ID of the player sent the messages whose queue status is desired. Zero returns information about all sent messages. If from is also specified, only information about messages that are both from player from and to player to is returned. You cannot specify a group ID for to.
flags
Flags indicating what type of information to obtain about the queue. Default (flags = 0) returns information about the send queue. Can be only one of the following values:
DPMESSAGEQUEUE_SEND
Retrieves information about the send queue.
DPMESSAGEQUEUE_RECEIVE
Retrieves information about the receive queue.
nMessage
Variable to receive the number of messages in the queue.
nBytes
Variable to receive the number of bytes in all messages in the queue.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following values:

DPERR_INVALIDFLAGS
DPERR_INVALIDPARAMS
DPERR_INVALIDPLAYER
DPERR_UNSUPPORTED

The method returns DPERR_INVALIDPLAYER if you check the receive queue (DPMESSAGEQUEUE_RECEIVE) while specifying to for a remote player. It returns DPERR_INVALIDPLAYER if you check the send queue (DPMESSAGEQUEUE_SEND) while specifying from for a remote player. It returns DPERR_INVALIDFLAGS if flags is DPMESSAGEQUEUE_RECEIVE Or DPMESSAGEQUEUE_SEND. It returns DPERR_UNSUPPORTED if you attempt to check the send queue when DirectPlay protocol is not turned on and the service provider does not support checking the send queue.

Remarks

By monitoring the status of the send queue, an application can regulate how many messages to send to other players in the session based on the bandwidth of the underlying network.