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

Ross Finlayson finlayson at live555.com
Mon May 11 06:15:36 PDT 2009


>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

There's really no alternative.  We can't just arbitrarily choose an 
even number ourselves, in case we get a port number that happens to 
be used by someone else.  And we also have to make sure that - if the 
code is run in more than one process (i.e., application) on the same 
host - we don't end up with more than one process accidentally using 
the same port number.


>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.

No, in general we're not going to "work around OS bugs" - especially 
ones as aggregious as this.  What I will do, however, is change the 
code - where it "Add()"s a record for a port number to the hash table 
- to check whether there was already a hash table entry (for the same 
port number) there - so at least we don't end up with a memory leak 
in this situation.

However, I find it difficult to believe that any OS - even WinCE - is 
really allocating the same emphemeral port number more than once in a 
row (while the first allocated port is still in use).  If this is 
really happening, then there must surely be a bugfix OS upgrade 
available, so you need to apply that first.  Sorry.
-- 

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


More information about the live-devel mailing list