Logo Search packages:      
Sourcecode: egoboo version File versions  Download package

void enet_peer_ping ( ENetPeer peer  ) 

Sends a ping request to a peer.

Parameters:
peer destination for the ping request
Remarks:
ping requests factor into the mean round trip time as designated by the roundTripTime field in the ENetPeer structure. Enet automatically pings all connected peers at regular intervals, however, this function may be called to ensure more frequent ping requests.

Definition at line 377 of file peer.c.

{
    ENetProtocol command;

    if (peer -> state != ENET_PEER_STATE_CONNECTED)
      return;

    command.header.command = ENET_PROTOCOL_COMMAND_PING;
    command.header.channelID = 0xFF;
    command.header.flags = ENET_PROTOCOL_FLAG_ACKNOWLEDGE;
    command.header.commandLength = sizeof (ENetProtocolPing);
   
    enet_peer_queue_outgoing_command (peer, & command, NULL, 0, 0);
}


Generated by  Doxygen 1.6.0   Back to index