ThunderMusic
Tue Mar 02 08:22:49 CST 2004
Wow!! Exactly what I was searching for.
Thanks a lot.
ThunderMusic
"William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in message
news:eAxTuEAAEHA.2808@TK2MSFTNGP10.phx.gbl...
> "ThunderMusic" <NOdanylat@sympatico.caSPAM> wrote in message
> news:ey7oax8$DHA.2012@TK2MSFTNGP11.phx.gbl...
> > ok, so I've read about pipes, but do you
> > have some examples of communication
> > with pipes?
>
> Yes. I like this sample:
>
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/multithreaded_pipe_server.asp
>
> The basic idea is that a server creates a pipe with a particular
well-known
> name. A little like a business with one telephone number which is
serviced
> by multiple telephone lines, the server can manage up to 255 "instances"
of
> that pipe. Each instance corresponds to one client "open" operation. The
> example above creates one thread to handle each client request. This is
very
> easy to code and a good option if you need to support a small number of
> clients.
>
> In detail the server calls CreateNamedPipe() to make itself available to
its
> clients. Each client calls CreateFile() specifying the server's host name
> and the name of the pipe. The client requests service by calling
> WriteFile(). The server receives the request by calling ReadFile().
>
> > Who must create the pipe? the service or the application?
>
> The server.
>
> > How can one tell the other what are
> > the handles for reading and writing?
>
> The client opens the pipe with CreateFile() which yields a handle. It uses
> that handle to write (send). The server opens the pipe, gets and handle
and
> reads (receives). For responses, the opposite operations are used. When
> done, each side closes its own handle.
>
> Regards,
> Will
>
>