diff --git a/README.md b/README.md index 2199083..af00fa6 100644 --- a/README.md +++ b/README.md @@ -48,15 +48,12 @@ The underlying library is based on callbacks and asynchronous operation. As such $c = new Mosquitto\Client; $c->onConnect(function() use ($c) { - $c->publish('mgdm/test', 'Hello', 2); + $c->publish('mgdm/test', 'Hello', 0); + $c->disconnect(); }); $c->connect('test.mosquitto.org'); - -for ($i = 0; $i < 100; $i++) { - // Loop around to permit the library to do its work - $c->loop(1); -} +$c->loopForever(); echo "Finished\n"; ```