code: async def reconnect(self):
          
          self.clean()
          try:
              self.writer.close()
          except:
              pass
          self.closed = True
          await self.connect()
          if self.debug:
              print("reconnect to {}".format((self.hostname, self.port)))
docs: 断线重连.