Azure / azure-umqtt-c

General purpose library for communication over the mqtt protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mqtt_client_sample.c program client program exits after receiving one or two messages,

kpdarshan opened this issue · comments

Hi Team,

mqtt_client_sample.c program exits after publishing and receiving one or two messages. The program exits quickly and wont wait in infinite loop.
MQTT_CLIENT_ON_DISCONNECT Disconnects message receives in OnOperationComplete() call back function and terminates the program.
Also, proper MQTT_CLIENT_ON_CONNACK messages is received in After connection to "test.mosquitto.org".

Please let me know why I am getting immediately MQTT_CLIENT_ON_DISCONNECT after MQTT_CLIENT_ON_CONNACK message in OnOperationComplete().
How to wait continuously for subscriber messages? What setting/configuration I need to do for client connection?

Thanks,
Darshan.

--------------------------------------------------------------------------------------------------------------Log: Not received any messages

platform_init started
DPK mqtt_client_connect passed
ConnAck function called
DPK MQTT_CLIENT_ON_DISCONNECT
DPK1 mqtt_client_connect passed
On Close Connection called
DPK Wait for the close connection gets called
DPK1 Wait for the close connection gets called
DPK mqtt_client_deinit
DPK platform_deinit

D:\Data\test\mqtt\azure-umqtt-c-master\azure-umqtt-c-master\build_all\windows\samples\mqtt_client_sample\Debug\mqtt_client_sample.exe (process 8744) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .

Log: 1 message received .

platform_init started
DPK mqtt_client_connect passed
ConnAck function called
Incoming Msg: Packet Id: 2
QOS: DELIVER_EXACTLY_ONCE
Topic Name: DPK
Is Retained: fale
Is Duplicate: true
App Msg: 0x540x680x690x730x200x690x730x200x530x680x720x650x790x200x4b0x610x6b0x610x640x650x2e
DPK MQTT_CLIENT_ON_DISCONNECT
DPK1 mqtt_client_connect passed
On Close Connection called
DPK Wait for the close connection gets called
DPK1 Wait for the close connection gets called
DPK mqtt_client_deinit
DPK platform_deinit

D:\Data\test\mqtt\azure-umqtt-c-master\azure-umqtt-c-master\build_all\windows\samples\mqtt_client_sample\Debug\mqtt_client_sample.exe (process 5452) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .

Log: 2 messages received.

platform_init started
DPK mqtt_client_connect passed
ConnAck function called
Incoming Msg: Packet Id: 3
QOS: DELIVER_EXACTLY_ONCE
Topic Name: DPK
Is Retained: fale
Is Duplicate: true
App Msg: 0x540x680x690x730x200x690x730x200x530x680x720x650x790x200x4b0x610x6b0x610x640x650x2e
DPK MQTT_CLIENT_ON_DISCONNECT
Incoming Msg: Packet Id: 4
QOS: DELIVER_EXACTLY_ONCE
Topic Name: DPK
Is Retained: fale
Is Duplicate: fale
App Msg: 0x540x680x690x730x200x690x730x200x530x680x720x650x790x200x4b0x610x6b0x610x640x650x2e
DPK MQTT_CLIENT_ON_DISCONNECT
DPK1 mqtt_client_connect passed
On Close Connection called
DPK Wait for the close connection gets called
DPK1 Wait for the close connection gets called
DPK mqtt_client_deinit
DPK platform_deinit

D:\Data\test\mqtt\azure-umqtt-c-master\azure-umqtt-c-master\build_all\windows\samples\mqtt_client_sample\Debug\mqtt_client_sample.exe (process 23544) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .

HI @kpdarshan ,
we really apologize for the time it took for us to get to this issue.
The umqtt repo is intended to be used by https://github.com/azure/azure-iot-sdk-c, with little to no support out of that scope.
Being, so, we will close this issue.
If you have questions regarding azure-iot-sdk-c, please file an issue on the appropriate repo.
Thanks,
Azure IoT SDK Team.