It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Ok, here goes.

I have a web server running in Python.

I have potentially several instances of my game engine running as standalone C++ processes.

They communicate with each other via sockets (given that the game engine needs to be expendable over several computers, sockets are a must).

So far, I've used barebone TPC/IP to communicate between server and engine(s) with a narrow custom-made protocol (ie, agreed upon hard formats for each type of request) which worked ok, because server-engine communications have been light (either I was mostly working on one or the other).

However, now I'm thinking I should extend my little protocol to pass along more complex structures via the sockets to save some development time and a few white hairs :).

My gut feeling is to go find some C/C++ XML library (if I can't find a satisfactory one in Python, I can always create a wrapper for it using the C/C++ library) and use that as an intermediate step (converting data structures to XML and then passing XML strings over the sockets re-creating the data structure from the string on the other end).

Before I start, get all invested and find out later I could have saved myself a lot of trouble using something else, does anyone know about a better solution?
Post edited September 19, 2011 by Magnitus
This question / problem has been solved by cjrgreenimage
XML-RPC is primitive as hell, but it does work, and it does have solid Python bindings.
avatar
cjrgreen: XML-RPC is primitive as hell, but it does work, and it does have solid Python bindings.
It's primitiveness is one of it's strong points tbh
avatar
cjrgreen: XML-RPC is primitive as hell, but it does work, and it does have solid Python bindings.
avatar
wodmarach: It's primitiveness is one of it's strong points tbh
I've had a lot of success with it, and yes, the fact that it is dirt-simple is a strong point, especially when you control both the server and the clients.
avatar
wodmarach: It's primitiveness is one of it's strong points tbh
avatar
cjrgreen: I've had a lot of success with it, and yes, the fact that it is dirt-simple is a strong point, especially when you control both the server and the clients.
I've used it (and it's forebears) for all kinds of crap (including a basic MMO test server for design work) it's incredibly effective but mindnumbingly frustrating at times... still one of the best XML implementations though
Thanks for the replies guys.

I inquired on another forum and apparently, there are C/C++ libraries for JSON which I used a fair bit for the AJAX component of my web server.

Given that it is more compact than XML and I'm more used to it, I'm inclined to go that route.

Edit: That said, I'll wait a bit for further suggestions before giving cookie points to cjrgreen for a good suggestion ;).
Post edited September 19, 2011 by Magnitus
This would really depend on the type of data I was trying to pass around. Still, if you don't have performance bottlenecks, I'd do it in an accessible language with which you can communicate from your C++ program. Java is awesome for this (there's a reason a ton of MMOs use this for net code) and I think Python is pretty robust as well.

Still it sounds like you essentially have a working solution. If you want an already rolled solution that holds your hand a bit more than what cjgreen suggested (and there's nothing wrong with his if you like what it gives you), you might try Hessian: http://hessian.caucho.com/

I tend to not use it because I tend to have the same platform on both ends and HttpInvoker ends up a bit easier (except on heavy stuff when I invariably get SOAP forced on me, ironically the S stands for "Simple" and SOAP is anything but).