code: func (cli *Client) send(p packet.Packet) error {
  	// Return an error if the Client has not yet connected to the Server.
  	if cli.conn == nil {
  		return ErrNotYetConnected
  	}
  
  	// Write the Packet to the buffered writer.
  	if _, err := p.WriteTo(cli.conn.w); err != nil {
  		return err
  	}
  
  	// Flush the buffered writer.
  	return cli.conn.w.Flush()
  }
docs: // send sends an MQTT Control Packet to the Server.