Pure python zmq protocol implementation
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples Add support for socket types, and specific untested support for v2 an… Dec 8, 2013
zmqproto don't send is_cmd as default. Jan 2, 2014
.gitignore add ignores. Sep 30, 2013
AUTHORS initial commit. Sep 30, 2013
COPYRIGHT initial commit. Sep 30, 2013
README.md Update readme. Sep 30, 2013
setup.py

README.md

Zmq Proto

A pure python zmq library.

Barebones python implementation so clients don't need to depend on the binary libraries. Good for portability.

The library implements protocols 1, 2 and 3. Only protocol 1 is really tested for now but more will follow as we polish the implementation.

At the moment uses twisted for networking, but it will be optional in the future.

Examples

print "Create test client"
p = ZmqSocket()
p.connect('tcp://192.168.1.171:9091')

# send some binary data
p.send('foo!', 1) # second parameter is the 'send more' flag
p.send('bar')

print "Create a test protocol"
proto = Zmq3Protocol()
greeting = proto.buildGreeting()
handshake = proto.buildReadyHandshake()

prop1 = proto.buildProperty('Socket-Type', 'DEALER')
prop2 = proto.buildProperty('Identity', '')

proto.dataReceived(greeting[:4])
proto.dataReceived(greeting[4:12])
proto.dataReceived(greeting[12:16])
proto.dataReceived(greeting[16:])
proto.dataReceived(proto.buildFrame(handshake+prop1+prop2))

reactor.run()

--

unsystem dev