Re: I'm trying to hurry, but I keep getting confused Ben Laurie (ben@algroup.co.uk)
Tue, 12 Jan 1999 20:23:05 +0000

Mark S. Miller wrote:
>
> At 08:41 AM 1/12/99 , Ka-Ping Yee wrote:
> >When a binding address is not specified, the socket listens on the given
> >port number on all interfaces, producing the effect you observed.
> >
> >If you only need to bind to all interfaces or one interface, then you
> >should be able to get by without extra threads.
>
> [#] This is wonderful!
> Just to double check, you're saying it is part of TCP/IP's semantics that
> one can use a single socket / a single port number to listen for
> connections coming in for this port number paired with each of the host's
> IP addresses, as the java.net API would seem to imply. If this isn't quite
> right, or isn't supported on a platform that matters, please speak up, as
> I'm about to proceed depending on this property. Thanks.

This is standard sockets behaviour - if you specify as your address INADDR_ANY (all zeroes) you listen on _all_ interfaces.

Note that many people find it desirable to have this configurable (if you are running in a secure environment, you often want to specify the interface you listen on).

Chers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi