+ # we kill off the process here because otherwise the class doesn't get
+ # destroyed until the end of the iteration. This causes us to hold more
+ # than MAX_TOTAL_AGENTS open for a period of time, which is a bad thing.
+ if self.IsDead():
+ try:
+ self.process.communicate( "BYE\r\n" )
+ except Exception, e:
+ print "Error in BYE:", self, ":", e
+
+ try:
+ self.process.kill()
+ except:
+ None
+
+