Reputation: 41
I read few Boost.Python tutorials and I know how to call C++ function from Python. But what I want to do is create C++ application which will be running in the background all the time and Python script that will be able to call C++ function from that instance of C++ application. The C++ application will be a game server and it has to run all the time. I know I could use sockets/shared memory etc. for this kind of communication but is it possible to make it with Boost.Python?
Upvotes: 1
Views: 464
Reputation: 28659
Boost python is useful for exposing C++ objects to python.
Since you're talking about interacting with an already running application from python, and the lifetime of the script is shorter than the lifetime of the game server, I don't think boost python is what you're looking for, but rather some form of interprocess communication.
Whilst you could create your IPC mechanism in C++, and then expose it to python using boost python, I doubt this is what you want to do.
Upvotes: 2