Microsoft DirectX 8.1 (Visual Basic)

DirectPlay8Client.Send

Transmits data to the server. The message can be sent synchronously or asynchronously.

Send(buffer() As BYTE, _
    lTimeOut As Long, _
    [lFlags As CONST_DPNSENDFLAGS]) As Long

Parts

buffer()
Array of type BYTE that describes the data to send.
lTimeOut
Number of milliseconds to wait for the message to be sent. If the message has not been sent by the lTimeOut value, the message is not sent. If you do not want a time out for message sends, set this parameter to 0.
lFlags
Flags that describe send behavior. You can set one or more of the following flags defined in the CONST_DPNSENDFLAGS enumeration.

Return Values

Returns the asynchronous handle for this operation. This is the handle that is used in lAsyncHandle parameter of the DirectPlay8Client.CancelAsyncOperation method to cancel the request, if the request is processed asynchronously.

Error Codes

If the method fails, Err.Number can be set to one of the following values.

DPNERR_INVALIDFLAGS
DPNERR_TIMEDOUT

Remarks

This method will call the DirectPlay8Event.Receive method in the server's message handler. When the Send request is completed, the DirectPlay8Event.SendComplete method is called in the client's message handler. The SendComplete method contains a DPNMSG_SEND_COMPLETE message type. The success or failure of the request is contained in the hResultCode member of this message type.