Skip to content
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

Invalid function arguments provided. client->loopForever() #108

Open
lifamomo opened this issue Jul 18, 2019 · 4 comments
Open

Invalid function arguments provided. client->loopForever() #108

lifamomo opened this issue Jul 18, 2019 · 4 comments

Comments

@lifamomo
Copy link

lifamomo commented Jul 18, 2019

call this function client->loopForever() , Often appear Invalid function arguments provided
below is the code I wrote:

public function send($msg){
try {
$mid = 0;
$mqttclient = new \Mosquitto\Client;
$gateway_topic = $this->topic;
$mqttclient->onConnect(function() use ($mqttclient, $gateway_topic,&$mid,$msg)
{
$mid = $mqttclient->publish($gateway_topic,$msg,$this->qos,1);
$mqttclient->disconnect();
});
$mqttclient->setCredentials($this->username, $this->password);
$mqttclient->connect($this->server, $this->port, 5);
$mqttclient->loopforever();
} catch (Exception $e) {
writeException($e);
}
echo "success";
}

please help, thank you!

@w297088867
Copy link

Fatal error: Uncaught Mosquitto\Exception: Invalid function arguments provided. : Mosquitto\Client->loop(100) .
A mistake similar to yours!!!!
help,help,help.

@creazy412
Copy link

@w297088867 @lifamomo
Hey, have you solved the problem?

@creazy412
Copy link

https://sources.debian.org/src/mosquitto/1.4.10-3+deb9u4/lib/mosquitto.c/
Line 990
But I don't see why null-pointer error

@neumantm
Copy link

I have the same problem. Did anyone find the cause?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants