delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/29/09:34:21

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 29 Apr 2005 15:33:35 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Select() hangs forever
Message-ID: <20050429133335.GA2572@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <6BD989BB73712F41B1EDD1B8A32EA4C385F72F AT EXCHANGEVS1 DOT comtechtel DOT com>
Mime-Version: 1.0
In-Reply-To: <6BD989BB73712F41B1EDD1B8A32EA4C385F72F@EXCHANGEVS1.comtechtel.com>
User-Agent: Mutt/1.4.2i

On Apr 28 11:48, Vladislav Grinchenko wrote:
> A small test program creates a UNIX domain socket and listens on an
> incoming connections. Then, from the same process, two ASYNC connections
> are attempted (think of it as a loopback within a process). Calling
> connect() on both returns "errno: 119 Operation now in progress" as
> expected. 
> 
> Then, to complete the connection establishment, I call select() on both
> FDs with Read/Write mask checked to see if in fact the connection is
> completed. The timeout is set to 1 seconds (I also tried different
> timeouts). The select() BLOCKS FOREVER and never returns (until I kill
> the process). 
> 
> I ran the program with 'strace' and attached the relevant log file. Can
> someone with working knowledge of cygwin networking code shed some light
> of what I might be doing wrong?

Nope.  Please reduce your testcase to the bare minimum(!) to reproduce
the hang and send the source code to this list.

Other than that, I'm not sure this will work reliably in Cygwin anyway.
I have strong reservations against using ASYNC mode(*).  Isn't it possible
to do the same with just using nonblocking I/O or perhaps threads?


Corinna


(*) Stevens(**) explains signal-driven I/O (aka async I/O) as not very
    useful and I can easily follow his reasoning.

(**) Stevens, W. Ricahrd, "UNIX Network Programming", "Vol 1: Networking
     APIs: Sockets and XTI", Prentice Hall, ISBN 0-13-490012-X,
     Chapter 22 "Signal-Driven I/O, pp. 589

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019