From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] nonblocking write/recv/send/connect/accept Date: 01 Jun 2002 17:58:29 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <87bsav0z4q.fsf@zagadka.ping.de> References: <20020327130351.B27416@kiwi.pyrotechnics.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1022947274 21829 127.0.0.1 (1 Jun 2002 16:01:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 1 Jun 2002 16:01:14 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17EBJa-0005fy-00 for ; Sat, 01 Jun 2002 18:01:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17EBIX-0003Zb-00; Sat, 01 Jun 2002 12:00:09 -0400 Original-Received: from dialin.speedway42.dip111.dokom.de ([195.138.42.111] helo=zagadka.ping.de) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17EBH0-0003Wr-00 for ; Sat, 01 Jun 2002 11:58:34 -0400 Original-Received: (qmail 932 invoked by uid 1000); 1 Jun 2002 15:58:29 -0000 Original-To: Christopher Cramer In-Reply-To: <20020327130351.B27416@kiwi.pyrotechnics.com> Original-Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:686 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:686 Christopher Cramer 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