code: def closed(self, reason):
          
          self.server.remove_connection(self)
          self.protocol.connection_lost(reason)
          if not isinstance(reason, ConnectionClosed):
              logger.warn("connection closed, reason: %s" % str(reason))
          else:
              logger.info("connection closed")
docs: Callback performed when the transport is closed.