mirror of https://github.com/eclipse/paho.mqtt.c
Merge pull request #1382 from CIPop/asyncsamplefix1
Async sample callback context fix.
This commit is contained in:
commit
43a7b48c03
|
|
@ -152,7 +152,7 @@ int main(int argc, char* argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((rc = MQTTAsync_setCallbacks(client, NULL, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS)
|
||||
if ((rc = MQTTAsync_setCallbacks(client, client, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS)
|
||||
{
|
||||
printf("Failed to set callback, return code %d\n", rc);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ int main(int argc, char* argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((rc = MQTTAsync_setCallbacks(client, NULL, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS)
|
||||
if ((rc = MQTTAsync_setCallbacks(client, client, connlost, messageArrived, NULL)) != MQTTASYNC_SUCCESS)
|
||||
{
|
||||
printf("Failed to set callback, return code %d\n", rc);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue