Delphi Service Application + Named Pipes

I developed a program for work, GUI interface, that ran a thread to complete file processing.
This application now needs to be turned into Service Application.

With using a GUI I could just use PostMessage() to tell my GUI what happened inside the server, like a reporting utility.
After the thread would compile the GUI would compile the data and then email a group of associates..

Since I'm turning this into a Service I can't use PostMessage(). I do not want to use PostTreadMessage as I would like to
develop a standalone application that can view what is occuring in the actual Service.
Basically I need this.

Main Application(Service Thread)
1) Create a Multithreaded Pipe Thread
2) Create Connection to Pipe
3) Spawn a CopyThread
4) Spawn a BuildPlan Thread
5) Read data from Pipe and process data (ReadFile Only)

Copy Thread
1) Connect to Pipe
2) Process file copies
3) WriteFile to Pipe with Status Report (WriteFile Only)

Build Plan Thread
1) Connect to Pipe
2) Process BuildPlan check
3) WriteFile to Pipe with Status Report of Check (WriteFile Only)

I've been diligently looking trying to find good examples to create a Named Pipe Thread that will allow multiple connections(both threads + standalone app) however I'm lost.

Could someone please provide an example or insight that will
a) create a named pipe
b) create a couple threaded connections to the pipe (writefile only)
c) read data into main application..
d) for standalone application be able to read everything that comes acrost the pipe.
yewnixAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Russell LibbySoftware Engineer, Advisory Commented:

You might take a look at the named pipe component set that I wrote, available at:

http://users.adelphia.net/~rllibby/downloads/pipes.zip

Both the server and client pipes run in async mode (including IO handling) by utilizing threads. The server was written to handle up to 100 connected clients (could be upped by modifying MAX_THREADS), and exposes events to notify of client connect, disconnect, error, data available, etc. I wrote this for D5, but with help of others it was modified to work correctly for D6/D7 as well. Should simplify any work that you need to do with named pipes.

Let me know if you have questions / problems,
Russell


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yewnixAuthor Commented:
This is a great help!
I haven't tested this out via an actual Service Application yet it seems to do well with GUI apps.
Incorporating this into a Service application with no GUI should work properly I would think.
Any comments ?
Russell LibbySoftware Engineer, Advisory Commented:

I know another individual using that component set in a service, and I believe all issues have been worked out (last year). You should not have any problems, but if you run into anything then let me know so I can address it.

Russell
yewnixAuthor Commented:
Thanks again. Works great!
Bruno BuesserCommented:
Russel's component can now be found at:

http://home.roadrunner.com/~rllibby/source.html

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.