[Sumover-dev] [svn commit] r4563 - vic/branches/mpeg4/net

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Fri Jan 22 15:42:18 GMT 2010


Author: piers
Date: Fri Jan 22 15:42:18 2010
New Revision: 4563

Modified:
   vic/branches/mpeg4/net/net-ip.cpp

Log:
Lets localhost address lookup fail back to using localhost address instead of crashing - it works but only for local traffic.


Modified: vic/branches/mpeg4/net/net-ip.cpp
==============================================================================
--- vic/branches/mpeg4/net/net-ip.cpp	(original)
+++ vic/branches/mpeg4/net/net-ip.cpp	Fri Jan 22 15:42:18 2010
@@ -250,9 +250,11 @@
 	 */
 	sockaddr_in local;
 	if (localname(&local) < 0) {
-		return (-1);
-	}
-	(IPAddress&)local_ = local.sin_addr;
+		//return (-1);
+		(IPAddress&)local_ = "127.0.0.1";
+		printf("Can NOT determine local IP address - using loopback address. If you want to be able to receive packets from other machines add this command line option: -i local_ip_addr \n");
+	} else
+                (IPAddress&)local_ = local.sin_addr;
 
 #ifdef WIN32
 	//if (!local_.is_set()) {



More information about the Sumover-dev mailing list