예제 #1
0
파일: Base.php 프로젝트: dethegeek/mqtt
 /**
  * Set Packet Identifier
  *
  * @param int $msgid
  */
 public function setMsgID($msgid)
 {
     $this->header->setMsgID($msgid);
 }
예제 #2
0
파일: PUBLISH.php 프로젝트: dethegeek/mqtt
 /**
  * Set Packet Identifier
  *
  * @param int $msgid
  * @throws Exception
  */
 public function setMsgID($msgid)
 {
     /*
     A PUBLISH Packet MUST NOT contain a Packet Identifier if its QoS value is set to 0 [MQTT-2.3.1-5].
     */
     if ($this->qos) {
         parent::setMsgID($msgid);
     } else {
         if ($msgid) {
             throw new Exception('MsgID MUST NOT be set if QoS is set to 0.');
         }
     }
 }