def on_close(self): logging.info("closed.") myapp.on_close(self)
def closed(self, code, reason): self._log("close") myapp.on_close(self)