Azure / Azure/amqpnetlite

Connection.HeartBeat with Xamarin on Android

Open
#366 0 comments 0 reactions 0 assignees View on GitHub
Info
Dominant language
C#
Stars
419
Forks
155
PR merge metrics
No merged PRs in 30d

Description

The implementation of `Connection.HeartBeat` uses `System.Threading.Timer`. Unfortunately Xamarin (Mono) on Android uses a Scheduler to implement the `Timer`.
When an app gets into suspend state the `Timer` does not trigger (by design), so the connection is disconnected by the broker (RabbitMQ / Azure Service Bus).

We solved this issue by simply changing the `Connection.HeartBeat ` to use a `Thread `with `AutoResetEvent.WaitOne`. So there is no dependency to different `Timer ` implementations.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.