Пример #1
0
/** Called when the GetPeerAddress protocol terminates.
 */
void ConnectToServer::callback(Protocol *protocol)
{
    switch(m_state)
    {
        case GETTING_SELF_ADDRESS:
            // The GetPublicAddress protocol stores our address in
            // STKHost, so we only need to unpause this protocol
            requestUnpause();
            break;
        case GOT_SERVER_ADDRESS:
            // Get the server address from the protocol.
            m_server_address.copy(((GetPeerAddress*)protocol)->getAddress());
            requestUnpause();
            break;
        default:
            Log::error("ConnectToServer",
                       "Received unexpected callback while in state %d.",
                       m_state);
    }   // case m_state
}   // callback
Пример #2
0
/** Called when the GetPeerAddress protocol terminates.
 */
void ConnectToServer::callback(Protocol *protocol)
{
    switch(m_state)
    {
        case GETTING_SELF_ADDRESS:
            // The GetPublicAddress protocol stores our address in
            // STKHost, so we only need to unpause this protocol
            requestUnpause();
            break;
        default:
            Log::error("ConnectToServer",
                       "Received unexpected callback while in state %d.",
                       m_state);
    }   // case m_state
}   // callback
/** Callback when the GetPublicAddress terminates. It will unpause this
 *  protocol, which triggers the next state of the finite state machine.
 */
void ServerLobbyRoomProtocol::callback(Protocol *protocol)
{
    requestUnpause();
}   // callback