Best practice to send a message to the client when the session expired

I would like to inform the clients (Xamarin.Forms iOS/Android) when their session has expired.

  1. How can I best do this both on the server side and on the client side?
  2. I would also like to inform all clients when a new client logs in / out. I would be very grateful for an example. I looked at the chat example and could only send / receive messages with it, however, if they were initiated by the client. How do I do this in my login / logout service and in my Program.cs (e.g. private static void SessionManager_SessionExpired (object sender, SessionEventArgs e))?
  3. Am I correct that an active session must exist in order to receive messages from the server? I would like to use this as a replacement for push notifications. Or is there a better solution?

My (Code First) DA Server runs on a Rasperry Pi

Thanks in advance for your help.


Unfortunately you cannot. Expired session means that all event queues associated with it already destroyed.

Take a look at the Chat and SuperHTTP Channel Chat samples shipped with Remoting SDK

Yes, default implementation implies that an active session is present.
Yes, it is possible to implement something Push-like using events. Even limitations will be more or like the same, like message delivery delay,

Just be sure to adjust min and max event polling timeouts when the app goes into background mode to maintain balance between being reasonably responsible vs draining device battery.