delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/12/22/12:29:45

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 22 Dec 2008 12:28:55 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Named pipes (blocking problem)
Message-ID: <20081222172855.GB27364@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <005b01c96455$6c6bed60$4001a8c0 AT mycomputer> <2ca21dcc0812220903k38b8923v892f508b2ec55620 AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <2ca21dcc0812220903k38b8923v892f508b2ec55620@mail.gmail.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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
Note-from-DJ: This may be spam

On Mon, Dec 22, 2008 at 05:03:02PM +0000, Dave Korn wrote:
>John Emmas wrote:
>> I'm trying to build a program that implements inter-process communication
>> using named pipes.  Because the code needs to also work under Windows
>> (MSVC++) it uses CreateNamedPipe(...) to create the pipes (described here):-
>>
>> http://msdn.microsoft.com/en-us/library/aa365150(VS.85).aspx
>>
>> If I understand the description, it seems that the created pipe can either
>> be blocking or nonblocking depending on whether the flag
>> FILE_FLAG_OVERLAPPED is specified at creation time.
>
>  Nope.  Overlapped and blocking are slightly different concepts;
>overlapped basically means "enabled for asynchronous I/O".  What
>you're looking for is PIPE_WAIT/_NOWAIT, further down the same page.

That's not exactly true.  You can use FILE_FLAG_OVERLAPPED to simulate
blocking or non-blocking behavior.

If the OP is creating a pipe using CreateNamedPipe and then trying to
somehow read it using Cygwin's I/O library then I wouldn't be surprised
to see strange behavior.  Otherwise, Cygwin does not impose any strange
limitations on CreateNamedPipe.

Note that if this really is just a pure Windows program you probably
should be using MinGW.

cgf

--
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