nn::ir::CTR::Communicator::AutoConnection Member Functionstatic Result AutoConnection();
None.
Result values listed below.| Value | Description |
|---|---|
Result::IsSuccess |
Process was successful. |
ResultBufferInsufficient |
The buffer was insufficient so the connection process could not proceed. |
ResultAlreadyConnected |
Already in the connected state. |
ResultAlreadyTryingToConnect |
In the process of connecting. |
ResultMachineSleep |
Sleeping because the system is in Sleep Mode. |
ResultFatalError |
The IR module may be malfunctioning. |
Tries to make an authenticated connection.
This function returns control before the connection is made.
This function repeatedly executes the processes described for the WaitConnection and RequireConnection functions while randomly changing the amount of time to wait for a connection request and the amount of time to wait after a request has been sent for a connection reply. These operations are repeated in an attempt to connect to a peer that is performing the same AutoConnection operations on its side.
The function runs repeatedly until a connection has been made. If you want to abort the process, therefore, call the Disconnect function.
If the connection succeeds, this is signaled by the event returned by the GetConnectionStatusEvent function.
Use GetConnectionRole to determine whether you sent the connection request or received it when the connection was established.
The ranges that define the minimum and maximum times to wait for connection requests and connection replies are defined by DEFAULT_WAIT_REQUEST_MIN, DEFAULT_WAIT_REQUEST_MAX, DEFAULT_WAIT_REPLY_MIN and DEFAULT_WAIT_REPLY_MAX. The amount of time to delay before making a connection reply is defined by DEFAULT_SEND_REPLY_DELAY.
The system always waits after connection authentication. If data has been provided by the Send function, the system sends the data packets after it has received all incoming data and then waits again.
If the size of the region used to save incoming and outgoing packets—as passed to the Initialize function—is smaller than that defined by NECESSARY_BUFFER_SIZE_FOR_CONNECTION or if the size of the region used to manage packets is smaller than GetManagementSize(1), the connection cannot be authenticated and this function fails.
CONFIDENTIAL