none
deviceClient.ReceiveAsync(cts.Token) stops receiving on amqp after a few minutes RRS feed

  • Question

  • I use this code:

    receivedMessage = await deviceClient.ReceiveAsync(cts.Token);

    and amqp. I need the cancellation token there instead of a timespan timeout, as the wait can get cancelled from another thread when the related IoT Gateway <> device socket dies.

    If I start my process, I can fire 10~20 messages through one after the other fine.

    If I wait a few minutes (seems to be about 4 minutes), the cloud to device messages stop coming in. The await deviceClient.ReceiveAsync(cts.Token) never seems to return a message or a NULL.

    No IoT Hub esception is thrown. I seem to remember the 4 minute is a magic number, and something may be happening?

    If I had the ability to use a cancellation token and a timeout together, that would be great.

    Anyone have any ideas?

    I am using Devices.Client V1.21.1



    MikeM


    Friday, October 11, 2019 2:40 PM

Answers

All replies