You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've altered the chatroom example to let the user exit the chatroom:
$console = new TcpConnection(STDIN);
$console->onMessage = function($console, $message) use ($mqtt){
$message=trim($message);
if ($message=="exit") {
$mqtt->disconnect();
die;
} else {
$mqtt->publish('testRoom', $message);
}
};
When the user enters "exit" I want the worker to stop but it reconnects always. I've tried using "$mqtt->doNotReconnect=true;" but it doesn't work.
Anyone knows how to do this?
The text was updated successfully, but these errors were encountered:
I've altered the chatroom example to let the user exit the chatroom:
When the user enters "exit" I want the worker to stop but it reconnects always. I've tried using "$mqtt->doNotReconnect=true;" but it doesn't work.
Anyone knows how to do this?
The text was updated successfully, but these errors were encountered: