code: func (c *Client) processDisconnect() error {
  	// clear will
  	c.will = nil
  
  	// mark client as cleanly disconnected
  	atomic.StoreUint32(&c.state, clientDisconnected)
  
  	// close underlying connection (triggers cleanup)
  	_ = c.conn.Close()
  
  	// ensure tomb is killed
  	c.tomb.Kill(ErrClientDisconnected)
  
  	c.backend.Log(ClientDisconnected, c, nil, nil, nil)
  
  	return ErrClientDisconnected
  }
docs: // handle an incoming disconnect packet