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

void enet_host_broadcast ( ENetHost host,
enet_uint8  channelID,
ENetPacket packet 
)

Queues a packet to be sent to all peers associated with the host.

Parameters:
host host on which to broadcast the packet
channelID channel on which to broadcast
packet packet to broadcast

Definition at line 190 of file host.c.

References enet_packet_destroy(), and enet_peer_send().

{
    ENetPeer * currentPeer;

    for (currentPeer = host -> peers;
         currentPeer < & host -> peers [host -> peerCount];
         ++ currentPeer)
    {
       if (currentPeer -> state != ENET_PEER_STATE_CONNECTED)
         continue;

       enet_peer_send (currentPeer, channelID, packet);
    }

    if (packet -> referenceCount == 0)
      enet_packet_destroy (packet);
}


Generated by  Doxygen 1.6.0   Back to index