How to bind a listening socket to an address?

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Mon Sep 1 16:12:06 UTC 2003


Andreas Raab wrote:

> The listening socket is always bound to the local network address (how could
> it be otherwise?)

No, a socket is always bound to a network interface (how could it be 
otherwise?). Each network interface has its own IP address. 127.0.0.1 is 
the local loop-back interface, while each network adapter has a 
different IP. If I bind a socket to 127.0.0.1, it will not be reachable 
from the outside. This is a Good Thing, like for a printer demon, font 
server etc. (*)

Squeak does unfortunately not support this. In the plain VM, a listening 
socket is always bound to _all_ network interfaces. I think there have 
been hacks to bind to specific interfaces, but I do not remember where 
exactly I saw this.

-- 
    Bert

(*) For example, at home I'm running a router / print server / wlan 
access point all on one machine, which has 4 network interfaces: 
external, LAN, WLAN, loopback. The DNS daemon, print server, Samba etc. 
are of course only bound to the internal interfaces and not accessible 
from the outside.



More information about the Squeak-dev mailing list