"Sean McKay" <[EMAIL PROTECTED]> wrote:
> Ok, I think we can setup a user with the permissions to start on port
> 80. We are using multiple IP addresses on our Solaris server and want to
> dedicate an IP address solely to the swiki server (because we have other
> apache servers serving on port 80 with different IP addresses). Is it
> possible to have it start and bind to a particular IP address for this
> server?
> 

I've been thinking about this.  While you can't do it in standard
Squeak, it shouldn't be too hard to modify the bind() primitive in
Squeak to take an extra argument if you have someone willing to spend 4
hours hacking, mostly in the VM.  It would go something like:

        1. Modify sqUnixSocket.c so that it has a new
primitiveSocketListenOnPortBlahBlah function that accepts a new
argument.  If you are feeling really hackish, just copy the existing
function and modify it to accept a new argument.  There is already code
to pick off arguments, so you can largely just modify this code.  To
figure out the format to use for the IP address, copy whatever the
primitiveSocketConnectToPort() function is using.

        2. Add a method to class Socket that invokes the primitive.  You might
name it primSocket:listenAt:onPort:backlog: .  If you look in the
"primitives" category, you can see how these methods are made.

        3. Add a nicer method for invoking the primitive.  Especially, the
first argument (socketID) should not be explicit to the external user. 
Also, the IP address should be a 4-element byte array, no matter what
the primitive is expecting.  (Maybe it's the same thing; I dunno from
the top of my head).  Squeak-level code uses 4-byte ByteArray's for IP
addresses.

It would be wonderful for someone, some day, to fill in Squeak's sockets
with all of the BSD semantics.  If we are using "sockets", then we may
as well emulate the guys who have put tons of experience and thought
into it, instead of implementing only the features that seem important
at the moment.  Ah well, that's a soap box for another day.  I'm
certainly not volunteering!


Lex

Reply via email to