Bob,
There are asynchronous methods on the named pipe classes. They begin
with "Begin" (e.g. "BeginRead", "BeginWrite"), where you will be notified
when they are complete (or you can poll if you wish). The synchronous
methods are simply called Read, Write.
Are you communicating between two .NET programs? If you don't have a
need to support other applications which don't have access to .NET or COM,
then why not use WCF with a named pipe binding? It would be much easier
than having to figure out the messaging pattern on your own, as well as
serialization of types across the channel.
--
- Nicholas Paldino [.NET/C# MVP]
-
Code:
Content visible to registered users only.
"Bob" <Bob@nospam.com> wrote in message
news:ukloi459bq3fv59mkldl228qqc0thri0jj@4ax.com...
>I had posted an inquiry under another thread, but I guess it was not
> noticed. A couple Q's for anyone familiar with the new
> Named Pipes classes:
>
> Is there an easy way to run asynchronously... to block the thread
> until data is received? (Most sample code uses "while (true)" polling
> loops which would waste CPU cycles)
>
> Also, is there a convention for which program is the 'server' and
> which is the 'client'? The limited sample code that I've seen set up
> the transmitting program as the client, but I'm not sure what
> difference that makes.
>