-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notice: Uninitialized string offset: 0 in C:\xampp\htdocs\phpMQTT\phpMQTT.php on line 242 Notice: Uninitialized string offset: 0 in C:\xampp\htdocs\phpMQTT\phpMQTT.php on line 249 Notice: Uninitialized string offset: 3 in C:\xampp\htdocs\phpMQTT\phpMQTT.php on line 250 #117
Comments
i am facing same issue |
1 similar comment
i am facing same issue |
MQTT3.1.1: The Server, upon the reception of a CONN packet, may or may not reply with a CONNACK (which this code is waiting for) but may just close the network connection if it does not like the look of the packet. The returned result in $string on line 240 could be empty! phpMQTT code does not seem to handle network connection failure properly anywhere in the code, so misbehaviour may occur else as well. phpMQTT does not seem to distinguish between a network connection and a session connection on most places (and this issue117 is one such places). |
I‘m not being rude,do you fixed this problem? |
One of the forks may have that fixed already but I haven't check. An temporary immediate fix is to check for the $string to be of the required length (4) first. eg, Change line 241 to: |
And you should also do similar check a few lines later for the when the error message is printed as well. |
The socket is opened successfully earlier in the code otherwise it would have already returned false. I also don't know why you wouldn't set the socket to blocking until it's read back the acknowledge from the broker. It's not doing anything else with the stream. |
I got the (maybe) the same errors After a while, I recognized, that I am connecting to a SECURE MQ connection, but with a broker, that has a valid SSL certificate, so I was not supplying anything as 'cafile' paramter. Try to change line 150 from
to
i.e. enforcing TLS connection instead of TCP connection. |
i couldnt solve can u look at this problem ?
The text was updated successfully, but these errors were encountered: