[Live-devel] Fwd: why am I getting "bad ports" in groupsock/GroupsockHelper.cpp:setupDatagramSocket()?

Virginia Hamm liverwurst at owal.io
Wed Sep 28 12:35:10 PDT 2016


On Tue, Sep 27, 2016 at 12:24 AM, Ross Finlayson <finlayson at live555.com>
wrote:

> > Now, a better question is, what's magic about 6970
>
> grep 6970 liveMedia/include/*.hh
>
> Yes, I found it (with grep -r)


> There’s nothing ‘magic’ about port number 6970; however, it was the
> default starting port number for Apple's (formerly frequently used, but now
> defunct) "QuickTime Media Server", so I decided to make this the default
> starting port number for our RTSP server - in case people’s firewalls were
> set up to allow port numbers in a small range, starting with 6970.
>
>
Ah, more brain-damage from Apple infecting software. Sigh...

Since there is no provision in the code to cycle back to the starting port,
all ports above 6970 would have to be opened. But I can fix this, along
with the starting port.



> Our RTSP server implementation (actually, “OnDemandServerMediaSubsession”,
> for unicast clients) chooses a port number to use for each client session.
> It does this by iterating over port numbers - beginning with the starting
> port number - until it finds one that is not in use (anywhere on the same
> host).  *** This is normal behavior; there is no ‘bug’ here. ***
>
> You *could* change the starting port number by setting the
> “initialPortNum” parameter (to something other than its default value of
> 6970) in the call to the “ProxyServerMediaSession” constructor.  To do
> this, though, you would need to define your own subclass of
> “ProxyServerMediaSession”.
>
>
 Too much subclassing is bad. This should just be an option.

Speaking of options: why don't you use getopt()? The original,
single-letter-option code has been around since at least 1985.


NOTE, HOWEVER, that this (‘per client session’) port number is COMPLETELY
> SEPARATE from the RTSP server’s base port number (e.g., 554 or 8554) -
> which is what the “-p” option specifies.  So it’s completely irrelevant to
> your real question:
>

This much is obvious. I only mentioned this to give some context as to why
I went about looking for what 6970 was.


>
> > What I was trying to figure out was how get the proxy to just terminate
> if the specified port in the -p option was not available
>
> This is real easy.  Call
>         RTSPServer::createNew()
> with the port number as (2nd) parameter.  If the port is unavailable, then
> this “createNew()” call will return NULL.
>
> (See, for example, code in “proxyServer/live555ProxyServer.cpp”.)
>
>
Right, that's what I"m doing, except I added code to terminate if the port
is not available, rather than try to use 554, 8554, or open something on
port 80.

Cheers

\/-/


>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
> --
> You received this message because you are subscribed to the Google Groups
> "Liverwurst" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to liverwurst+unsubscribe at owal.io.
> To post to this group, send email to liverwurst at owal.io.
> To view this discussion on the web visit https://groups.google.com/a/
> owal.io/d/msgid/liverwurst/50559ACC-EBD7-4E2B-AECF-
> 6B16DE365A53%40live555.com.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20160928/74e5935c/attachment.html>


More information about the live-devel mailing list