DWC_SendReliable

C Specification

#include <dwc.h>

BOOL DWC_SendReliable ( u8 aid, const void* buffer, int size );

Description

After matchmaking completes, this function performs a Reliable send via UDP to the AID specified in aid.

With Reliable send, data is delivered to the communications partner in the order it was sent, with no duplication or packet loss. However, it will take longer for the send to complete, since each packet is checked when it arrives.

If data sending is impeded on a layer lower than the DWC, the data is stored in the send buffer with the size specified by the DWC_InitFriendsMatch function. If there is not enough space in the send buffer and a Reliable sending is attempted, the data that could not be sent is stored as is and is sent from the DWC_ProcessFriendsMatch function as soon as space opens up in the send buffer.

Also, the maximum data size that can be sent at one time is determined (the default is 1465 bytes). If data larger than this is sent, the send data is divided up, and the send is suspended. The maximum data size can be changed with the DWC_SetSendSplitMax function. To maintain compatibility with differently configured communications devices, try not to set the size above the default.

While the send data is suspended in this manner, do not delete the send buffer. Also, no further data can be sent during the suspension.

It is possible to check whether or not a Reliable send is possible, including whether there is empty send buffer space and if the send destination AID is valid, by using the DWC_IsSendableReliable function.

When the send completion callback is configured with the DWC_SetUserSendCallback function, the callback is called when the data send is complete. However, the send completion does not guarantee delivery to the communication partner and only means that data was passed to a low-layer send function.

You can get the AID of connected DS devices using the DWC_GetAIDList function.

By using the DWC_SendReliableBitmap function, a Reliable sending can be made to multiple AIDs at one time.

Arguments

aid AID for the send destination.
buffer Pointer to the send buffer.
size Size of the send buffer.

Return Values

TRUE The data set is completed for the send buffer.
FALSE The data set failed for the send buffer.
Either an error has occurred, the previous send process has not ended, an invalid AID was specified, or there is not enough space in the send buffer.

See Also

DWC_SendReliableBitmap DWC_SendUnreliable, DWC_SendUnreliableBitmap, DWC_InitFriendsMatch, DWC_ProcessFriendsMatch, DWC_SetSendSplitMax, DWC_IsSendableReliable, DWC_SetUserSendCallback, DWC_GetAIDList

Revision History

05/22/2006 Corrected the explanation regarding errors
02/22/2006 Changed description of the return values to give more detail
12/16/2005 Added a detailed function description
11/14/2005 Added more on Reliable sends
07/22/2005 Initial version