The problem is that: the UDP listening ports increase rapidly and eventually come to the end: too many open file in selector. As many as the hosts you lookup, those UDP ports are still alive. It is very different from running this script in Linux (gentoo 2.6). In Linux, the listening UDP port keep only 1 instance no matter how many lookups . Try the script below: ------------------------------ from twisted.mail import relaymanager from twisted.internet import reactor,defer
global MXC MXC = relaymanager.MXCalculator() def getMailExchange(host): global MXC def cbMX(mxRecord): print 'Got mxRecord: %s' % mxRecord.name return MXC.getMX(host).addCallback(cbMX) def run(): d = getMailExchange('gmail.com') def next(mxRecord): d = getMailExchange('yahoo.com') #d.addCallback(next) ## uncomment the line to increase your UDP listening ports as many as you want reactor.callWhenRunning(run) reactor.run() -------------------------------------------------- Any hints?
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python