Skip to content
simple socket rpc client/server for gevent and twisted
Find file
Pull request Compare This branch is even with pcdummy:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Socketrpc client/server


This is a simple socket rpc client/server for gevent and twisted

I use this a replacement for "Perspective Broker" of Twisted as i'm switching from Twisted to gevent.

It uses a very simple dataformat to transfer calls:

Client: --> {call: [method, args, kwargs, call_id]}
Server: <-- {reply: [status, result, call_id]}

On the network level it uses a sized format:

[(uint16_t)serialized size][serialized data]


Client: --> {"call": ["echo", ["hello world"], {}, 1]}
Server: <-- {"reply": [0, "hello world", 1]}

Its also possible for the server to call on the client:

Server: --> {"call": ["echo", ["hello world"], {}, 1]}
Client: <-- {"reply": [0, "hello world", 1]}


  • Symmetric calls over a single socket
  • Supports different serializers
  • Native implementions for both Twisted and gevent


  • gevent >= 0.13.0 for the gevent variant
  • Twisted >= 10.1 for the twisted variant

  • bson for the bson serializer

  • jsonlib for the jsonlib serializer


  • 0.0.X - Docs, bugfixes and Unittests
  • 1.0.0 - Stable API, following from this point on


For now see examples/ and examples/

  • Start a gevent server with the bson serializer

    $ ./examples/ -d -s bson server

  • Run 100 calls on the server

    ./examples/ -d -s bson -r 100 clientserial

  • Run a bounced call (Client calls server to call the client)

    $ ./examples/ -d -s bson clientsingle


Copyright (c) 2011 Rene Jochum, See LICENSE for details. (NEW-BSD)

Something went wrong with that request. Please try again.