sskaje / mqtt

MQTT Client class
https://sskaje.me/category/MQTT/
MIT License
86 stars 33 forks source link

MQTT 3.1.1 #4

Closed sskaje closed 8 years ago

sskaje commented 9 years ago

http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html

w3yyb commented 9 years ago

https://github.com/w3yyb/MQTT-CN/blob/master/mqtt-v3.1.1-os.md 中文版

sskaje commented 9 years ago

You may see it pushed in two or three weeks.

w3yyb commented 9 years ago

同一消息的PUBACK, PUBREC, PUBREL messageid一致,客户端必须通过msgid确定qos1, qos2消息。 这个 php客户端id处理可能有错误,只保留了last message ID,应该保存未响应的sub、unsub、qos1、qos2 publish。

w3yyb commented 9 years ago

ok, very good, but have a problem ,unsubscribe not work

sskaje commented 9 years ago

@w3yyb new issue with more details ?

w3yyb commented 9 years ago

protected function do_unsubscribe() {

set msg id

    $msgid = mt_rand(1, 65535);
    # send SUBSCRIBE
    $unsubscribeobj = $this->getMessageObject(CrystalPushMessageType::UNSUBSCRIBE);
    $unsubscribeobj->setMsgID($msgid);
    foreach ($this->topics_to_unsubscribe as $tn=>$topic_name) {
        if (!isset($this->topics[$topic_name])) {
            # log
           // continue;    //  cancel this line  unsubscribe will work good 去掉这行就行了 
        }
w3yyb commented 8 years ago

黑黑,这是要更新了吗