Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16466

Re: Need some IPC pointers

References <4ED69A1A.3080609@gmail.com>
Date 2011-12-01 13:14 +1100
Subject Re: Need some IPC pointers
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3185.1322705669.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Dec 1, 2011 at 8:03 AM, Andrew Berg <bahamutzero8825@gmail.com> wrote:
> processes (that aren't necessarily written in Python) ...
> non-local processes would be nice ...
> The implementation needs to be cross-platform ...
> I don't think I'll ever need to transfer anything complicated or large -
> just strings or possibly tuples/lists.
> I'm thinking sockets, but perhaps there's something simpler/easier.

Definitely sockets, as other posters have said. The only question is,
what encapsulation format (since sockets give just a stream of bytes).
Since you want non-Python processes to be involved, I would be
inclined to avoid using Python's own pickling system; JSON may be
viable, and it's well known so you should be able to find support in
other languages. Alternatively, take a careful look at your dataset
and invent your own system. If your strings will never contain a pipe
character, you could define a tuple/list to be simply pipe-separated
strings; if they'll never contain newlines, you can specify your
protocol to be newline-terminated. For command/response protocols over
TCP/IP, I strongly recommend poking around with existing protocols
such as the email trio (SMTP, POP, and IMAP); there's many good ideas
to be gained from them.

If you can, try to keep your protocol to ASCII text. It makes
debugging far easier, as you can simply point a telnet/mud client at
your server and manually step through things.

Chris Angelico

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Need some IPC pointers Chris Angelico <rosuav@gmail.com> - 2011-12-01 13:14 +1100

csiph-web