Determining if data is available on a stream

  • Thread starter Thread starter Henning Friese
  • Start date Start date
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
 
In case anyone cares: The Win-32-Function PeekNamedPipe works with
anonymous pipes too and does the job.
 
Back
Top