Hi,
I ran into a problem with how DarwinStreamingServer handles dynamic network
interfaces. The scenario is as follows
Machine A:
==========
(1) I run DarwinStreamingServer
(2) I run the open source bluetooth stack (bluez)
Machine B:
==========
(1) I run bluetooth on windows
(2) I establish a PAN (IP over bluetooth) connection to Machine A.
(3) At this point a virtual network interface is created on Machine A and B.
It is the IP over bluetooth network connection.
Now, If I try to view a stream from machine B (file->open url in new
player), I see an assert on line 163 in the file Socket.cpp. The code
snippet is shown below
StrPtrLen* Socket::GetLocalAddrStr()
{
if(fLocalAddrStrPtr == NULL)
{
for(UInt32 x = 0; x < SocketUtils::GetNumIPAddrs(); x++)
{
if(SocketUtils::GetIPAddr(x) =
ntohl(fLocalAddr.sin_addr.s_addr))
{
flocalADdrStrPtr =
SocketUtils::GetIPAddrSTr(x);
break;
}
}
}
assert(fLocalAddrStrPtr != NULL); <====This assert fires
return fLocalaDdrStrPtr;
}
So...basically, the method is trying to reuse the pointer to a cached,
string represenation of the ip address. I looked at the code a bit and found
that when the server starts up SocketUtils::Intialize queries all availalbe
network interfaces and caches the information and creates a string
representation of IP addresses. It appears that this is used in other
locations such as Socket::GetLocalAddrStr.
Well, the problem here is that the virtual network interface over bluetooth
is created dynamically, in other words, the interface doesn't exist when
DarwinStreamingServer starts. So the cache that SocketUtils maintains will
NOT contain the string representation of this ip address, hence the assert.
I was thinking of changing the code to not use the cached representation. I
could just convert the address to a string and store it as a member of the
Socket object. Does someone more familiar with the code have other
suggestions on what the right way to fix the bug is?
The problem boils down to the assumption that all network interfaces will be
present when DarwinStreamingServer starts up. In my case, the IP over
bluetooth virtual network interface is created on demand. Indeed, it can
come and go many times.
thanks,
Murali
_______________________________________________
streaming-server-developers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/streaming-server-developers
Do not post admin requests to the list. They will be ignored.