[ENet-discuss] Multicast/Broadcast Addresses

Giuseppe Greco giuseppe.greco at agamura.com
Tue Sep 4 11:09:39 PDT 2007


Hallo guys,

I'm wondering what's about multicast and broadcast addresses...

In the following statements it looks like broadcast datagrams
are not discarded:

static int
enet_protocol_handle_incoming_commands (
     ENetHost * host, ENetEvent * event)
{
         ...
         if (peer -> state == ENET_PEER_STATE_DISCONNECTED ||
             peer -> state == ENET_PEER_STATE_ZOMBIE ||
             (host -> receivedAddress.host != peer -> address.host &&
               peer -> address.host != ENET_HOST_BROADCAST))
           return 0;
         ...
}

Would it make sense to modify the statements above like this?

static int
enet_protocol_handle_incoming_commands (
     ENetHost * host, ENetEvent * event)
{
         ...
         if (peer -> state == ENET_PEER_STATE_DISCONNECTED ||
             peer -> state == ENET_PEER_STATE_ZOMBIE ||
             (host -> receivedAddress.host != peer -> address.host &&
               peer -> address.host != ENET_HOST_BROADCAST) &&
               !IN_IS_ADDR_MULTICAST (peer -> address.host) ))
           return 0;
         ...
}

Of course, ENetHost/ENetSocket would need to be modified in order to
let applications join the desired multicast groups...

I'm just trying to understand whether or not ENet would be
suitable for multicasting.

Tx,
j3d.

-- 
----------------------------------------
Giuseppe Greco
Via Carà 26
6928 Manno
Switzerland

call giuseppe.greco via Skype
phone:  +41 (0)91 604 67 65
mobile: +41 (0)79 590 33 06
email:  giuseppe.greco at agamura.com
----------------------------------------


More information about the ENet-discuss mailing list