Communication between C++ server and Python app

K

kenk

Hi,

I've got a server process written in C++ running on Unix machine.
On the same box I'd like to run multiple Python scripts that will
communicate with this server.

Can you please suggest what would be best was to achieve this ?

Kind regards and thanks in advance!
M.
 
R

Roy Smith

kenk said:
Hi,

I've got a server process written in C++ running on Unix machine.
On the same box I'd like to run multiple Python scripts that will
communicate with this server.

Can you please suggest what would be best was to achieve this ?

There are so many reasonable answers, it's hard to know where to start.
Perhaps if you could give us some clue as to what the server does, it
might help.

What kind of data are you passing back and forth? Text? Binary? Is it
important that the communication be as efficient as possible, or is it
more important that the code be easy to write? Are you worried about
security? Will you ever need to interoperate with other systems written
in other languages?
 
K

kenk

Failr point - I should do that in original question.

The C++ server runs on Unix (Mac OS X as a matter of fact) and, as I'm
the one who develops it, can use whthever technology is suitable.
Currently it uses STL, Boost and Qt libraries.

The server is responsible for providing connectivity to stock exchange
and will be used mainly to monitor price of certain financial
instruments and placing/cancelling orders.
My idea is to keep this as simple tool that will execute whathever
it's asked for.

On top of this server I plan to write some trading logic in Python -
scripts that will trigger certain actions depending on situation on
market.

I planned to exchange text commands between the C++ server and Python
scripts as Python is really good in parsing text and on server side
Boost/STL also do the trick.
Communication between 'logic' and the server won't be high frequency -
I plan to talk to teh server ~10 times a minute.

Will appreciate suggestions.

M.
 
M

Miki Tebeka

I've got a server process written in C++ running on Unix machine.As said before, there are many options. Here are some:
* protobuf, thrift, avro ...
* json/xml over http
- Python has XMLRPC module
* zeromq
* ...

IMO investigate some time learning the options, code a simple api using one or two that you like and pick a winner.

For 10 calls/min you can go that wrong either way :)
 
P

premiumtelco

I normally wouldn’t be able to find such great content as this on other
sites. You have done a great job with each unique point made on this topic.
Thank you for your hard work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top