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

Virginia Hamm liverwurst at owal.io
Mon Sep 26 20:50:42 PDT 2016


On Mon, Sep 26, 2016 at 6:13 PM, Ross Finlayson <finlayson at live555.com>
wrote:

> > +      env << "Bad port number (@1): " << port.num() << "\n";
> >        return -1;
> >      }
> >  #if defined(__WIN32__) || defined(_WIN32)
> >
> > Now, whenever a client connects to the proxy, I get errors such as:
> >
> > Bad port number (@1): 14875
> > Bad port number (@1): 15131
>
> You realize, I hope, that the function “Port:num()” returns the port
> number in network byte order.  If you want to see the actual port number
> (in host order), you should be outputting “ntohs(port.num())”
>

red face time... failed like a n00b :)

here's the correct output:

Bad port number (@1): 6970 (0x1b3a)
Bad port number (@1): 6971 (0x1b3b)
Bad port number (@1): 6972 (0x1b3c)
Bad port number (@1): 6973 (0x1b3d)
Bad port number (@1): 6974 (0x1b3e)
Bad port number (@1): 6975 (0x1b3f)
Bad port number (@1): 6976 (0x1b40)
Bad port number (@1): 6977 (0x1b41)
...
This is, of course, initialPortNum = 6970 from
 liveMedia/include/ProxyServerMediaSession.hh



>
> > In trying to debug something probably unrelated to this
>
> Please tell us what problem that you’re *really* having, rather than
> trying to diagnose the problem yourself.
>
>
>
I'm trying to run multiple proxy processes on the same machine, each
connecting to a different back end ("why multiple processes?", I hear you
ask. Well, the back ends may come and go, and reappear on different
addresses, and I don't want to restart *everything* when that happens)

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 (so that I would then
restart it with a different port). I added diagnostic statements wherever a
port number was being allocated, and got confused about the UDP port being
allocated in setupDatagramSocket() returning with errors.

Now, a better question is, what's magic about 6970 and why does the
(apparenly not significant) choice of port start at that value? Why not
just create the socket and just get the port that was allocated to it by
the kernel (from the range in the local port range, in linux:
net.ipv4.ip_local_port_range = 32768    60999)?

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/ow
> al.io/d/msgid/liverwurst/B3C977D5-7189-4AB6-AE7A-287D27E3517
> 6%40live555.com.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20160926/0fe211fe/attachment.html>


More information about the live-devel mailing list