A few weeks ago, someone on the list mentioned Rendezvous support for
Twisted. Curious, I picked up the Rendezvous specification documents,
and got to hacking.
What I've got so far is almost half a multicast DNS responder. The
multicast DNS specification covers two main areas - asking other hosts
for DNS records and serving out DNS records yourself. My code at the
moment sends out queries and caches the responses in more or less the
proper fashion, but does not respond to requests.
The upshot …
[View More]of all this is that you can look things up over multicast
DNS, but you can't advertise your own services.
The code was written on Linux and tested against Mac OS X 10.2.6
(it'll never run on OS X or any other operating system that includes a
Rendezvous service), and seems to Do The Right Thing.
You can find a nice tarball here:
http://members.optusnet.com.au/thristian/mDNS-0.5.tar.gz
It contains the main module (mDNS.py) and a simple API demonstration
(mDNS-test.py). There's lots of comments and docstrings, so it
shouldn't be too hard to figure things out.
If you're interested in Rendezvous support for Python, download it and
have a play, then tell me what you think.
--
___________ ___________________________________
| Screwtape | http://livejournal.com/~thristian |______ _____ ___ __ _ _ _ _
|
| "At 640x480 the world is peaceful 'cos noone can see well enough to aim"
|
[View Less]
What is the right way of unit testing protocols in twisted ?
Currently, I'm just subclassing my protocol with unittest.TestCase
And directly calling the dataRecieved with a string and am checking
If the overridden callbacks (like dataRecieved) are called.
The tests pass, but back when I was writing threaded servers,
I would actually setup a server on localhost and would connect to
The server from another thread, for unit testing. That gives me a lot
more confidence.
I know that I can setup …
[View More]two reactors, for the client and the server
and then try to make them talk, But I'm sure there's a shortcut.
I just could'nt figure out the test suites from the Twisted sources.
Jeethu Rao
[View Less]