I don't understand why function sendConnect like this.MQTTClient.php:228
Closed this issue · 2 comments
ching631108 commented
My ClientID is "admin-000". I think this clientID is OK. but MQTTClient.php:228 like this,
if(preg_match("/[^0-9a-zA-Z]/",$clientId)) { $this->debugMessage('ClientId can only contain characters 0-9,a-z,A-Z'); return false; }
I think this code means that: when my $clientId like "admin-000", then report an error: "'ClientId can only contain characters 0-9,a-z,A-Z'", which I did.
Maybe this one is OK. I verify that
if(!preg_match("/[^0-9a-zA-Z]/",$clientId)) { $this->debugMessage('ClientId can only contain characters 0-9,a-z,A-Z'); return false; }
karpy47 commented
I believe that you are not allowed to use "-" in the client id according to the Mqtt 3.1 specification. Just remove it.
ching631108 commented
yeah,my mistake. Thank you!