X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-4.6 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
X-Received: by 10.52.26.200 with SMTP id n8mr20423471vdg.72.1361312204497; Tue, 19 Feb 2013 14:16:44 -0800 (PST)
In-Reply-To: <20130219144600.GE23688@calimero.vinschen.de>
References: <CANjopZGmp+xaUg1Sn2FTmb77igMk8R=Lp9yBWyeDtDj3RP5R=g@mail.gmail.com>	<loom.20130205T082932-242@post.gmane.org>	<CANjopZHH2kv0s0pitt0beFiC=tsP5bOsSBJ8TBhSWnSD-iP7fg@mail.gmail.com>	<loom.20130206T131835-535@post.gmane.org>	<CANjopZHhRZts4nOm6h19h2xY02=7L5WNuVypDkLqo2cojUG2zA@mail.gmail.com>	<5114A38B.6060201@gmail.com>	<CANjopZExQ_qZc90jOi9qEZ+mvw4o87hOw_fAa8JhEDOfV+yQJA@mail.gmail.com>	<20130219144600.GE23688@calimero.vinschen.de>
Date: Wed, 20 Feb 2013 07:16:44 +0900
Message-ID: <CANjopZHYnCJfhT7_8fSijiukf5gcpGdW3bOU610Uy_kULTZNCg@mail.gmail.com>
Subject: Re: non-blocking accept() can hang.
From: Tanaka Akira <akr@fsij.org>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

2013/2/19 Corinna Vinschen
>
> I debugged your example code, and it can't work on Cygwin.  The problem
> is that accept/connect on AF_LOCAL sockets performs a handshake
> operation to make sure that the other side of the socket is a Cygwin
> process as well, and to propagate credential information between
> client and listener.  The way it's implemented right now requires that
> both sides of the socket are responsive.  That's a safe thing for the
> accept call here, but since there's neither a blocking connect, nor a
> select or poll call waiting on the connecting side of the socket, nothing
> goes forward.
>
> To get this code working, you have to use either AF_INET or AF_INET6
> sockets, or you have to start a thread calling select or poll, so
> there's an active function call which allows to perform the handshake
> from the connecting side.

Thank you for the information.
I'll use threads.
-- 
Tanaka Akira

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

