<font size="2">
<p>Hi!</p>
<p>First, I'm not much experienced with enet so sorry if I'm wrong in some parts of the following discussion.</p>
<p>I've readed the following post: "How to send a broadcast message without connecting to any one?".</p>
<p>I have the same problem, a client that search servers in a LAN, wich are not registred as enet peers of a host.</p>
<p>So the default enet_host_broadcast function doesn't fit to my intentions. </p>
<p>I must send a broadcast packet through the LAN network, so I coded the following:</p>
<p> </p>
<p>int</p>
<p>enet_host_network_broadcast (ENetHost * host_origin, ENetPacket * packet)</p>
<p>{</p>
<p>ENetAddress target_address; </p>
<p>ENetBuffer buffer; </p>
<p>target_address.host = ENET_HOST_BROADCAST;</p>
<p>target_address.port = host_origin->address.port;</p>
<p>buffer.data = packet->data;</p>
<p>buffer.dataLength = sizeof(packet->data);</p>
<p></p>
<p>return enet_socket_send (host_origin->socket, &target_address, &buffer, 1);</p>
<p>}</p>
<p>In my "FindServers" client function, I use the new "enet_host_network_broadcast" enet function,</p>
<p>sending a FIND_SERVERS_REQUEST message. But this message is never read by the server.</p>
<p>Reading some posts in the mailing list I found a discussion about Multicast/Broadcast addresses (Giuseppe Greco giuseppe.greco at <a href="http://agamura.com">agamura.com</a> </p>
<p>Tue Sep 4 11:09:39 PDT 2007), that talks about broadcast datagrams discarding and shows the following code</p>
<p>static int</p>
<p>enet_protocol_handle_incoming_commands (</p>
<p>ENetHost * host, ENetEvent * event)</p>
<p>{</p>
<p>...</p>
<p>if (peer -> state == ENET_PEER_STATE_DISCONNECTED ||</p>
<p>peer -> state == ENET_PEER_STATE_ZOMBIE ||</p>
<p>(host -> receivedAddress.host != peer -> address.host &&</p>
<p>peer -> address.host != ENET_HOST_BROADCAST))</p>
<p>return 0;</p>
<p>...</p>
<p>}</p>
<p>The questions are: </p>
<p>I will be able to receive the FIND_SERVERS_REQUEST message if I modify "enet_protocol_handle_incoming_commands" removing "peer -> address.host != ENET_HOST_BROADCAST" condition?</p>
<p>Are there some kind of risks doing it?</p></font>