[bind10-dev] python command channel committed

Michael Graff mgraff at isc.org
Wed Oct 7 17:03:10 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It's under experiments/graff-ccapi/python

Here's a simple test program that sends and receives messages.  I have a
Ruby version which does the same thing, and they talk to each other.  Whee.

import ISC

# test the low-level message API
m = ISC.CC.Message()
ss = { "list": [ 1, 2, 3 ],
       "hash": { "hash1": 1, "hash2": 2 },
       "none": None,
       "string": "samplestring" }
s = m.to_wire(ss)
ISC.Util.hexdump(s)
print m.from_wire(s)

# test the higher level channel-based API
tcp = ISC.CC.Session()
print tcp.lname

tcp.group_subscribe("test")

counter = 0
while counter < 10000:
    tcp.group_sendmsg({ "counter": counter }, "test", "foo")
    routing, data = tcp.group_recvmsg(False)
    counter += 1


The first part tests the low level API, which in general won't be used
directly.  The second part connects to the message daemon, subscribes to
a test group, and then loops sending and receiving messages.

- --Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrMyc4ACgkQ+NNi0s9NRJ3wKQCbBgKeP3cmLv7gNBLK+rLLNLKE
v3cAoIIYKvfzYkD3HxxhthryiBYxjsoc
=ThjW
-----END PGP SIGNATURE-----



More information about the bind10-dev mailing list