This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Named pipes (blocking problem)


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]