Communication between C++ server and Python app

Tamer Higazi th982a at googlemail.com
Sun Apr 29 07:00:50 EDT 2012


Take the twisted library.
I used to write myself a socket server and client.

Socket is fast, but you need on the other hand to know how big the
dataset might be, that will be serialized and deserialized as well.



Tamer

Am 29.04.2012 08:24, schrieb Cameron Simpson:
> On 29Apr2012 11:42, Chris Angelico <rosuav at gmail.com> wrote:
> | On Sun, Apr 29, 2012 at 10:45 AM, kenk <marcin.maksymiuk at googlemail.com> wrote:
> | > 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 ?
> | 
> | Personally, I would recommend a TCP socket, because that allows the
> | flexibility of splitting across multiple computers.
> 
> And the pain of ensuring security, if you're in an open network.
> 
> | But for
> | efficiency, you may want to consider a Unix socket too.
> 
> A UNIX socket or even a named pipe has the benefit of:
>   - not being available remotely
>   - access control with normal UNIX permissions
> and of course efficiency as you say.
> 
> Generalising to a TCP socket later shouldn't be too hard if the need
> arises.
> 
> Cheers,




More information about the Python-list mailing list