[plt-scheme] bind(2) on a client socket.
It looks good to me I'll do some testing later on to be sure.
I did neglect to mention an issue that I think you've addressed correctly in your modifications.
With my origninal patch the following would be allowed:
(tcp-connect "www.google.com" 80 "10.0.0.1")
While testing I discovered that under Linux (2.6) the socket would be bound to 10.0.0.1 and the kernel would pick the port number. Under FreeBSD an error would be returned (errno 49). So there exists a trade off between functionality and portability.
The commited version doesn't accept
(tcp-connect "www.google.com" 80 "10.0.0.1")
So the change that is commited maximizes portability, but sacrifices some functionality (with a workaround) on some systems. I think that your change is the correct way to go but I thought it would be wise to bring the trade-off to the foreground.
On a different note I've noticed that the docs haven't been updated for this change I don't know if thats due to the lag in regenerating the docs, or if it's just a todo item that hasn't been gotten to yet. I understand that the source for the docs isn't available, but would it be beneficial, for patch submitters to submit patches agains the *generated* docs, or a text file with the proposed doc changes, or should I just settle down and learn to be patient?
Evan
On Sun, May 22, 2005 at 10:03:30AM -0600, Matthew Flatt wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> At Fri, 20 May 2005 15:15:43 -0600, Evan Farrer wrote:
> > On a project that I'm working on I need to be able to bind a *client* sockets
> > local port. I couldn't find a way to do this in DrScheme so I modified tcp-
> > connect to take two additional optional parameters, a host and a port.
>
> Patch applied in CVS - thanks!
>
> I adjusted a few small things, mostly related to error checking. I
> think I got it right, but let me know if I messed up anything.
>
> Matthew
>