views:

68

answers:

4

I have one "server" process running, which will fetch data over the network for other processes running on the same machine as the server process.

How should I transfer data from the local server process and the local clients?

+1  A: 

You should check out Boost.Asio it fits your problem and is solid.

radman
+2  A: 

For retrieval of network data by the server process, Boost.Asio as suggested by @radman is a good choice.

Between server and local clients, Boost.Interprocess would be more efficient as this is interprocess data transfer, not requiring network usage.

Each of these Boost libraries provides a ready-to-run wrapper around complex underlying Win32 APIs, so you will likely get a working solution faster by using the libraries than by building your own special-purpose code with equivalent function.

Steve Townsend
A: 

Standard TCP sockets work fine for interprocess communications between multiple processes on the same machine or different machines. It's standard, supported on almost all platforms and in almost all programming languages. You should be able to find sample C++ code easily.

To connect to a socket on the same machine, use "localhost" as its name or 127.0.0.1 as its IP.

Irish Buffer
A: 

I believe Windows has named pipes, which would work similarly to the suggestions in the other answers (especially @Irish's TCP sockets suggestion). See CreateNamedPipe() for details.

Jonathan