invalid ip addr on hg serve

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Mar 27 11:29:51 CDT 2008


On Thu, 27 Mar 2008 12:58:48 +0000, "TK Soh" <teekaysoh at gmail.com> wrote:
> On Thu, Mar 27, 2008 at 12:00 PM, Martin Geisler <mg at daimi.au.dk> wrote:
>>>>>     % hg serve -v
>>>>>     listening at http://XXX.YYYY.net:8000/ (0.0.0.0:8000)
>>>>>
>>>>>  What am I missing?
>>>>
>>>> It means hg is listening on all interfaces, you can use -a to only
>>>> listen on localhost for example.
>>>
>>> What does 'all interfaces' refer to? Sorry I am not familiar with
>>> the concept.
>>
>> Your computer can have several "network interfaces". If you have two
>> network cards in the machine, then there will be a network interface
>> for each.
>>
>> But your computer also has a "virtual" network card which listens to
>> the address 127.0.0.1 also known as localhost. This interface is
>> always present and is often used for TCP communication between
>> processes that live on the same machine.
>
> Thanks to everyone on helping to clarify this. I'd suppose relatively
> few users have more than one network card? ;-)
>
> As an 'ordinary' user, I have to say the '0.0.0.0' itself is not clear
> enough. Perhaps it can be replaced with something a little more
> descriptive?

Maybe we could add an exception to the display code, so that when Hg is
listening on all interfaces, it is displayed in a more UNIXy way?  For
example, many network reporting tools show '*' when all the interfaces
are used, i.e. here is the output of sockstat(1) on a BSD system:

keramida at kobe:/home/keramida$ sockstat -l4 | sed -n -e 1p -e /sshd/p
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     sshd       1123  3  tcp4   *:22                  *:*
keramida at kobe:/home/keramida$

the *:22 `LOCAL ADDRESS' part means `all interfaces'.  Maybe we could
tweak the display code in `hg serve', to use `*' instead of 0.0.0.0 too?




More information about the Mercurial mailing list