-
Notifications
You must be signed in to change notification settings - Fork 147
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
Is it normal when i publish some messages like this? #11
Comments
Not completely sure but I thing the php script will keep running until something appear on the browser page. even if you close the page I assume the web server keeps the script active. |
Yeah, that'll be it. It won't know the connection has closed until you try and write to it.
|
it's weird,lookat the following code: } when the $num is less than 20,the subscrive side receive the mesagges correctly,but when the $num is larger than 20 the subscrive side only can receive 20 messages..Any solution? |
You need to call |
mytest.php:
$client = new Mosquitto\Client();
$client->connect("x.x.x.x", 1883, 60);
while ($client->loop() == 0) {
$message = "Test message at " . date("Y-m-d H:i:s");
$client->publish('mytopic', $message, 0, false);
$client->loop();
sleep(1);
}
When i first use browser open mytest.php ,the subscribe side receive the message sucessfully,but i close the page,the subscribe side still can receive the message ,what's going wrong?
The text was updated successfully, but these errors were encountered: