code: func (c *client) connect() (byte, bool) {
  	DEBUG.Println(NET, "connect started")
  
  	ca, err := packets.ReadPacket(c.conn)
  	if err != nil {
  		ERROR.Println(NET, "connect got error", err)
  		return packets.ErrNetworkError, false
  	}
  	if ca == nil {
  		ERROR.Println(NET, "received nil packet")
  		return packets.ErrNetworkError, false
  	}
  
  	msg, ok := ca.(*packets.ConnackPacket)
  	if !ok {
  		ERROR.Println(NET, "received msg that was not CONNACK")
  		return packets.ErrNetworkError, false
  	}
  
  	DEBUG.Println(NET, "received connack")
  	return msg.ReturnCode, msg.SessionPresent
  }
docs: // This function is only used for receiving a connack
  // when the connection is first started.
  // This prevents receiving incoming data while resume
  // is in progress if clean session is false.