Squeak listening to specific IP Addresses?

Andreas Raab andreas.raab at gmx.de
Tue Jan 20 19:41:06 UTC 2004


Hi Guys,

Someone with a bit more socket knowledge should chime in here but it seems
to me that this almost cries for a primitive doing the equivalent to BSD's
bind() call - e.g., assign a local address and port to a socket. So wouldn't
it be easier just to expose something like:

Socket>>bindTo: localAddress port: localPoirt

rather than trying to put all of this information in all of the varying
places?

Cheers,
  - Andreas

----- Original Message ----- 
From: "Peter William Lount" <peter at ActiveInfo.CA>
To: "Squeak Developers" <squeak-dev at lists.squeakfoundation.org>
Sent: Tuesday, January 20, 2004 7:58 PM
Subject: Re: Squeak listening to specific IP Addresses?


> Hi,
>
> Thanks for the assistance.
>
> 1) Listening to Specific IP Addresses
> Socket (and OldSocket) have a method that activates a primitive to listen
on
> a specific IP Address and Port pair:
>
> OldSocket >>primSocket: aHandle listenOn: portNumber backlogSize: backlog
> interface: ifAddr
> Socket>>primSocket: aHandle listenOn: portNumber backlogSize: backlog
> interface: ifAddr
>
> This seems to enable the listening of connections for "incoming"
> conversations providing the ability to run multiple instances of a service
> on the same port but with different ip addresses. i.e. 1.2.3.4:80 and
> 5.6.7.8:80.
>
> Excellent.
>
>
> 2) Connecting From Specific IP Address (and Port)
> Socket>>primSocket: socketID connectTo: hostAddress port: port
>
> There doesn't seem to be a way to initiate an "outgoing" connection FROM a
> particular IP Address on a multi-homed computer. You can choose the
address
> and port of the destination for the connection but you can't choose the
> from/source ip address (and port). The address likely defaults to the
> computer's default address. This is fine when there is one ip address but
> when the computer has multiple ip addresses (i.e. multi-homed) it is a
> problem, especially when it's important to use particular ip addresses for
> particular purposes (i.e. logging, bandwidth tracking, web servers,
etc...).
>
> In a full socket protocol you can specify both "source ipaddress:port" and
> "destination ipaddress:port" pairs for outgoing connections. I propose
that
> we extend the Squeak primitives (as follows) to support this full
protocol.
>
> "All selection of the outgoing ip address to use. Allow system to choose
> outgoing port."
> Socket>>
>     primSocket: socketID
>     connectTo: destinationAddress port: destinationPort
>     connectFrom: sourceAddress
>
> Obviously the source address MUST be one of the ip addresses that the
local
> computer is currently assigned. As such this method really only makes
sense
> on multi-homed computers. This shouldn't allow "spoofing" of the sending
ip
> address.
>
> "Allow selection of the outgoing ip address to use. In addition request
the
> outgoing port to use."
> Socket>>
>     primSocket: socketID
>     connectTo: destinationAddress port: destinationPort
>     connectFrom: sourceAddress port: sourcePort
>
> Generally you don't care which outgoing port is used (as it might be in
use
> already) so the first method is used more often.
>
> Obviously we'd need the non-primitive methods as well.
>
> Does any version of squeak have these or equilivant primitives?
>
> What do you think? I definitely need to have the ability to choose the
> outgoing ip address since they are assigned for particular purposes.
>
> All the best,
>
> Peter William Lount, Smalltalk.org Senior Editor
> peter at smalltalk.org
> peter at activeinfo.ca
>
> p.s. Would it be possible to add my email alias peter at activeinfo.ca to be
> accepted by the squeak list? I already receive the list to
> peter at smalltalk.org but sometimes I send from the alternate email address.
>
>
>




More information about the Squeak-dev mailing list