Squeak listening to specific IP Addresses?

Andreas Raab andreas.raab at gmx.de
Tue Jan 20 20:35:23 UTC 2004


Hi Ian,

> This is already _precisely_ what aSock listenOnPort: aPort backlogSize:
> nConn interface: anAddr does.

Yes, I understand this - I was more thinking along the lines of actually
simplifying the listen primitive(s) so that the ST side would look along the
lines of:

listenOn: port backlogSize: count interface: ipAddr

    self bindTo: ipAddr port: port.
    self listen: backlogSize.

etc. So #bindTo:port: would handle all the aspects that are now done in the
primitive and listen primitive would just listen on the locally assigned
address - which means that the socket prims actually model the underlying
BSD socket semantics much more closely, are easier to implement and probably
a bit easier to use.

> (nothing more, nothing less).  IOW, the only difference between the
> prim and bind() is that the prim goes on to perform the listen() as
> well, since you're pretty much guaranteed to want to do that after
> binding the address.

Not if you want to use a specific local interface in a connect() call (that
was the starting point for the discussion). In general I think it's
advantageous to model the Squeak primitives to closely resemble the BSD
sockets interface just on the general grounds of simplifying the VM
implementation. So that
- #primitiveConnect has the semantics of connect()
- #primitiveListen has the semantics of listen()
- #primitiveBind has the semantics of bind()
etc.

Cheers,
  - Andreas




More information about the Squeak-dev mailing list