user1382306
user1382306

Reputation:

how 2 c++ programs call each other's class/functions on same linux box?

I'm brand new to c++, so my vocab's probably off.

I currently make 100% ajax sites but want to work in websockets to autoupdate relevant clients.

I'm using fastcgi++ and websocket++. I'd like to serve all data via the websocket but update the database via ajax calls. My problem comes in when I want to have the ajax page trigger the websocket.

I've read about sockets, fifo, and pipes, but I'm not sure which one is ideal for this situation.

For two c++ programs, one ajax & one websocket, on the same linux box, how can the ajax program safely and asynchronously call a function in the websocket program?

Upvotes: 1

Views: 264

Answers (1)

David Schwartz
David Schwartz

Reputation: 182779

Have both programs talk to the same database. If you need some way to "throw a dart" at the other to notify it to check the database, you can use shared memory or a pipe. Sending one byte through the pipe is sufficient.

Upvotes: 2

Related Questions