def handle_close(self): s = MMPState() if self.addr[1] != 4404: s._set("_source", "psyc://%s:%d/" % self.addr) else: s._set("_source", "psyc://%s/" % self.addr[0]) self.packetReceived( s, "_notice_circuit_broken\nYour TCP connection to [_source] was broken by the bull from the china shop\n.\n", ) self.close()