code: async def disconnect(self, abort=False):
          
          if self.state == 'connected':
              await self._send_packet(packet.Packet(packet.CLOSE))
              await self.queue.put(None)
              self.state = 'disconnecting'
              await self._trigger_event('disconnect', run_async=False)
              if self.current_transport == 'websocket':
                  await self.ws.close()
              if not abort:
                  await self.read_loop_task
              self.state = 'disconnected'
              try:
                  client.connected_clients.remove(self)
              except ValueError:  # pragma: no cover
                  pass
          self._reset()
docs: Disconnect from the server.
  
          :param abort: If set to ``True``, do not wait for background tasks
                        associated with the connection to end.
  
          Note: this method is a coroutine.