def stopFactory(self): print "Stopping Groupweave server" for client in self.clients: client.sendMessage("Server is shutting down!") client.transport.loseConnection() Factory.stopFactory(self)