Skip to content

darkwallet/zmqproto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

License and Contribution Policy

We use the libzmq license (LGPLv3 + static link exception) as specified in the LICENSE file in this repo.

This project abides by the C4.1 process for contributions. See http://rfc.zeromq.org/spec:22

--

unsystem dev

About

Pure Python ZMQ implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages