[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] tcp-connect doesn't correctly signal errors
From: |
Michael Benfield |
Subject: |
Re: [Chicken-users] tcp-connect doesn't correctly signal errors |
Date: |
Thu, 15 Sep 2005 01:23:22 -0400 |
oops; I accidentally sent this just to the individual and not to the
list. Here's a copy of what I sent.
On Sep 14, 2005, at 9:50 PM, John.Cowan wrote:
That is the documented behavior, at least under Unix. From write(2):
Indeed. But in C, the connect function returns -1 on error, and so I
know that the socket file descriptor won't work. In Chicken Scheme,
tcp-connect returns two ports that appear to be valid until I use them
and my program is killed. I have no way of knowing that the ports I've
received aren't valid, and so tcp-connect is not safe to use in real
code (unless I want to actually try to deal with the SIGPIPE signal,
which I don't). tcp-connect should signal an exception. As it does if,
for example, I do this:
(tcp-connect "fakeurlthatdoesntexist.org" 12345)
Maybe I'm just missing something here but I don't think so.
- Mike Benfield