Ramadheer Singh
Ramadheer Singh

Reputation: 4234

Streaming data from C++ program?

I want to stream some data from my program for other subscribers (other programs). These programs can use these data as streaming event.

What I want?

I will dig more information on my own even if I get a small hint.

Example :

Program A : Object A changed =======> Program B : Report Change in Object A

Upvotes: 3

Views: 2880

Answers (4)

Andrew Edgecombe
Andrew Edgecombe

Reputation: 40362

Broadly it sounds like you're trying to perform inter-process communication, aka IPC.

In the tags to your question you refer to Windows. This link provides a broad list of the IPC options within Windows.

The tag list for your question also says platform-independent. Either a socket based solution or a Pipe based solution will mostly standard across a large number of platforms that you're likely to develop for. You can either use sockets directly or use one of the numerous cross-platform wrappers, eg. ZeroMQ and Boost, to hide some of the detail.

It's not clear from the question whether Program A and Program B are running on the same machine? If not then using sockets is a better approach.

Upvotes: 0

Christopher Oezbek
Christopher Oezbek

Reputation: 26303

Best I found:

  • Google Protobuf
  • Facebook Thrift

Pros:

  • Helps with establishing the formats for streaming
  • Fast
  • Easy to build

Cons:

  • List item
  • Other top-level design issues (bandwidth control, cancelation) have to go on top.

Upvotes: 0

Cory Nelson
Cory Nelson

Reputation: 29981

Two things are generally used: sockets/pipes which are just your basic byte streams, and message passing which is a bit more complex, made for parallel use and horizontal scalability.

Upvotes: 2

Denis C
Denis C

Reputation: 422

I am not sure if it is a bit advanced, but have a look at boost::asio http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/overview/core/basics.html

Upvotes: 0

Related Questions