Designing socket messaging format

Manoj Plakal terabaap at yumpee.org
Mon Nov 12 20:46:57 EST 2001


Cimarron Taylor wrote:

> shriek at gmx.co.uk (Stephen) wrote in message news:<97ae44ee.0111111912.14006c7f at posting.google.com>...
>>I'm developing a program which sends messages back and forth 
>>between two servers using sockets.  The message format I've 
>>been given is "YYYYTTTTTTTTTTTTTTTTTTTTTTT"
>>
> 
> Why not save yourself a little coding and just use netstrings?
>      more info: http://itamarst.org/multiplex
>  advogato copy: http://www.advogato.org/article/212.html 
>    python code: http://itamarst.org/downloads/multiplex-0.2.tgz
>    description: http://cr.yp.to/proto/netstrings.txt


      On a somewhat related note, consider the problem
      of a cross-platform way of communicating between
      applications on the same machine (this is
      in the context of applications exposing some
      functionality so that they can be scripted in
      some way). What's a good portable way of doing
      this? With the added constraint of being general,
      i.e., a general way of querying and calling methods
      exposed by arbitrary applications ...

          - Unix has all kinds of IPC mechanisms,
            but these won't work on Windows. And
            vice versa. Dunno about MacOS (X).

          - I could stick to BSD sockets and cook up
            my own protocol over UDP/TCP, but then
            each application has their own protocol
            which must be learnt.

          - Using XML-RPC, SOAP or CORBA in some form.
            These seem very heavyweight for simple
            inter-application messaging. They also
            require some sort of registration server/broker
            to hook up the communicating parties.
            Gnome and KDE are using CORBA-style protocols
            for their inter-app messaging, but this is not
            portable to Windows and I don't want to rely
            on Gnome/KDE or having a broker running.

       Basically, we need a portable, light-weight messaging
       protocol with a simple way of finding out how
       to connect to an application and calling some
       of the methods it exposes. Without having to
       do HTTP and XML and all that stuff that comes
       with XML-RPC and SOAP.

       I came across Scarab at http://casbah.org/Scarab/
       This is interesting though the project's been abandoned.

       Any comments?

       Manoj





More information about the Python-list mailing list