From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] nonblocking write/recv/send/connect/accept
Date: 01 Jun 2002 17:58:29 +0200 [thread overview]
Message-ID: <87bsav0z4q.fsf@zagadka.ping.de> (raw)
In-Reply-To: <20020327130351.B27416@kiwi.pyrotechnics.com>
Christopher Cramer <crayc@pyro.net> writes:
> Here it is. scm_connect was a little tricky and it actually looks very
> ugly to me, but the connect system call was really not designed for this
> sort of thing =^(.
Right, I have to trust you that it works :-)
The patch contains a lot of code of the form
{
int n;
SELECT_TYPE writefds;
int flags = fcntl (fd, F_GETFL);
if (flags == -1)
scm_syserror ("fport_flush");
if (!(flags & O_NONBLOCK))
{
do
{
FD_ZERO (&writefds);
FD_SET (fd, &writefds);
n = scm_internal_select (fd + 1, NULL, &writefds, NULL, NULL);
}
while (n == -1 && errno == EINTR);
if (n == -1) scm_syserror ("fport_flush");
}
}
Could you try to collect this pattern into its own set of functions
(ala fport_wait_for_input)? I think this will make the code much
cleaner.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-06-01 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-27 19:03 [PATCH] nonblocking write/recv/send/connect/accept Christopher Cramer
2002-05-22 13:20 ` Marius Vollmer
2002-06-01 15:58 ` Marius Vollmer [this message]
2002-06-29 1:07 ` Christopher Cramer
2002-06-29 11:50 ` Marius Vollmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bsav0z4q.fsf@zagadka.ping.de \
--to=mvo@zagadka.ping.de \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).