Determining if data is available on a stream

H

Henning Friese

Hello HG,

I'm using anonymous pipes for ipc between multiple processes. The
pipes are created with win32-functions since there is no support for
pipes in the dotnet-framework. To access the pipe I create FileStream-
objects from the pipe-handles.

Reading and writing through those streams works fine. However, I need
to know if data is avaliable on a pipe/stream since a call to Read()
is blocking. Is there anyway to detect if theres data available on a
FileStream. Or is there another Stream-Type i could wrap around the
pipes which supports this function? Any help would be highly
appreciated!

Cheers
Henning
 
H

Henning Friese

In case anyone cares: The Win-32-Function PeekNamedPipe works with
anonymous pipes too and does the job.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top