[Orxonox-commit 2617] r7322 - code/branches/ipv6/src/libraries/network

adrfried at orxonox.net adrfried at orxonox.net
Thu Sep 2 03:11:40 CEST 2010


Author: adrfried
Date: 2010-09-02 03:11:40 +0200 (Thu, 02 Sep 2010)
New Revision: 7322

Modified:
   code/branches/ipv6/src/libraries/network/LANDiscovery.cc
Log:
IPv6 Multicast LANDiscovery

Modified: code/branches/ipv6/src/libraries/network/LANDiscovery.cc
===================================================================
--- code/branches/ipv6/src/libraries/network/LANDiscovery.cc	2010-09-01 22:24:49 UTC (rev 7321)
+++ code/branches/ipv6/src/libraries/network/LANDiscovery.cc	2010-09-02 01:11:40 UTC (rev 7322)
@@ -52,13 +52,20 @@
   void LANDiscovery::discover()
   {
     this->servers_.clear();
+    ENetPeer* peer;
     ENetAddress address;
-    enet_address_set_host(&address, "255.255.255.255");
+    memset(&address, 0, sizeof(ENetAddress));
     address.port = LAN_DISCOVERY_PORT;
 
-    ENetPeer* peer;
+    /* TODO: check for availability of each protocol */
+    /* IPv4 */
+    address.host = ENET_HOST_BROADCAST;
     peer = enet_host_connect(this->host_, &address, 0, 0);
 
+    /* IPv6 */
+    enet_address_set_host(&address, "ff02::1"); // TODO: use a multicast group
+    peer = enet_host_connect(this->host_, &address, 0, 0);
+
     ENetEvent event;
     while( enet_host_service(this->host_, &event, 1000 ) )
     {




More information about the Orxonox-commit mailing list