[Live-devel] Infinite loop in liveMedia/MediaSession.cpp with Windows CE

Pierre Ynard linkfanel at yahoo.fr
Mon May 11 03:37:21 PDT 2009


Hello,

> But if the port was allocated the first time (and recorded in the 
> hash table), then your OS should never be allocating it (as an 
> ephemeral port) a second time!  If your OS really is doing this 
> (allocating the same ephemeral port number a second time, while the 
> first-allocated port is still in use), then it is badly broken, and 
> our code has no chance of working with it.  If this is really 
> happening, you will need to fix (or replace) your OS.

I work with Denis, and this is the same problem that happened in last
December
(http://lists.live555.com/pipermail/live-devel/2008-December/009967.html).
Yes indeed, this time, just as before, the same source port is returned
by WinCE. At that time, manually incrementing the port number did the
trick. Now that a more sophiscated hash table has implemented, manual
handling of the port number is gone, and so is the work-around for
WinCE, thus the recent breakage.

I agree that WinCE should not be doing that. However, IMHO, requesting
a port over and over, assuming that the OS will eventually give you
something suitable, is a risky behavior. The socket API doesn't
guarantee that it will return an even port in a quick and efficient way
for your application, it might as well try and exhaust all 30000+ odd
ports first, making the code slow, clogging the hash table, leading to
memory failure, EMFILE errors...

So I think that it would be appropriate for live555 code to implement
some measures making sure that this doesn't happen, and while we're at
it, possibly working around OS bugs.

Kind regards,

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the live-devel mailing list