#include <dwc.h>
int DWC_CloseAllConnectionsHard(void);None.
| 0 | Close operation complete. |
| 1 | Close processing was performed, but because there are no connected hosts, DWCConnectionClosedCallback cannot be called. |
| -1 | No action taken because the connection to the Wi-Fi Connection service has not been established or an error has occurred. |
If matchmaking is in progress, this function cancels it and returns participants to "online" communications status. If the local host is already connected to other hosts, this function closes the connection with all hosts currently connected. The close process completes within this function. Before this function exits, the callback function (DWC_SetConnectionClosedCallback) set with the DWCConnectionClosedCallback function is called for each connection that is closed.
Participants remain logged on to Nintendo Wi-Fi Connection.
If matchmaking is underway and the local host has not yet connected to any other hosts, this function behaves almost identically to the DWC_CancelMatch function, except that the matchmaking completion callback (DWCMatchedSCCallback) is not called. Use this function as much as possible instead of the DWC_CancelMatch function.
If connections are closed by this function, the other hosts are notified of this closing and each call the close callback DWCConnectionClosedCallback. However, because this close notification is sent only once over UDP communications, the notification may not reach its destination, depending on connection conditions.
This function can be called even if there are no connected hosts yet. In this case, if there is remaining space in the memory region used for matchmaking, it is released and the local host returns its own communications status to online. (For more about "communications status," see the description of the DWC_GetFriendStatus function.)
If the server host calls this function, server migration occurs, and subsequent matchmaking continues for the remaining client hosts. For client hosts to complete matchmaking without server migration, call this function inside the DWCConnectionClosedCallback callback generated on the client host side when a server host disconnects.
To disband a group in the process of matchmaking, a procedure such as the following is required: First, the game calls the DWC_SendReliable function or a similar function to indicate matchmaking termination. The client hosts that receive the indication of matchmaking termination then call the DWC_CloseAllConnectionsHard function on their side first. Once the server host judges that notification of matchmaking termination is complete, the server host calls this function last of all.
For the changelog prior to 5.1 PR2, click here.
CONFIDENTIAL