sockets/ip addresses
Tue, 12 Jan 1999 13:02:17 -0500

In the interest of clarity, I'll answer in different language than MarkM's.

The *normal* behavior of a socket listen() call is to accept all connections on a particular port without regard to the IP number of the interface on which they arrived. This is supported on all platforms.

In some circumstances it is desirable to say "accept only from this IP port". Such behavior is possible, but requires a few additional lines of code in the application. This is *not* supported on all platforms, but is probably supported on all of the platforms we care about.


"Mark S. Miller" <> on 01/12/99 12:11:33 PM

To: Ka-Ping Yee <>
cc: "Mark S. Miller" <>, E Language Discussions

<> (bcc: Jonathan S Shapiro/Watson/IBM) Subject: Re: I'm trying to hurry, but I keep getting confused

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

Using this property, it's much easier for E to deal with multiple interfaces. One listen socket per vat, period.