[Live-devel] Problems on iPhone when on cell network

Ross Finlayson finlayson at live555.com
Fri Jun 10 14:41:18 PDT 2011


Sorry for the long delay in responding to this.  (I've been traveling 
for the past two months, and am way behind on email.)

>Unable to determine our source address: This computer has an invalid 
>IP address: 0x0

Our code (specifically, the function "ourIPAddress()" in 
"groupsock/GroupsockHelper.cpp") uses two mechanisms (in succession) 
to try to find the computer's IP address:

1/ It sends a multicast packet, then receives it and looks at the IP 
source address.

2/ If step 1/ fails, the code then calls "gethostname()", extracts 
the resulting domain name, and then calls "gethostbyname()" on this 
domain name.

Step 1/ is by far the most reliable mechanism of the two (because 
many systems either don't have a domain name, or else "gethostname()" 
and/or "gethostbyname()" aren't supported).  However, for Step 1/ to 
work, you *must* have IP multicast working on your system.  In 
particular, you need to have a route installed on your system for 
224/8.  Nonetheless, this is the first thing that people should try 
to do if they encounter this problem.

Now, I'm (pleasantly) surprised to learn that you have the "LIVE555 
Streaming Media" code working on an iPhone, because our documentation 
does not include instructions for compiling for the iPhone.  (If 
anyone would like to contribute some instructions/tips for doing 
this, I'd be happy to add them to our online documentation.) 
However, because you're getting this error, it means that both 1/ the 
iPhone's OS doesn't have an IP multicast route installed for 224/8, 
*and* 2/ the combination of "gethostname()" and "gethostbyname()" 
isn't working.  If you can't fix either 1/ or 2/, then you'll have to 
come up with some other mechanism for getting your IP address.  (If 
you can do this, let us know, and we'll consider adding it (as a 
third mechanism to try) to our "ourIPAddress()" code.)
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list