Reputation:
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
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