问题
I use SignalR on my Android app to exchange messages. Everything works fine, but I just do not know how to resend the message I sent when disconnected from the Internet when I connect to the Internet.
please help me
i I kept the messages in the list until after connect to internet they were sent back one by one, but this is a wrong way and it does not work.
回答1:
You could store your messages in a database table. When a client is connected have messages delivered that are in the database. When the client has received through a function, have a response back to the HUB to do a function (mark the messages read or delete them from the table, etc...).
If a client gets disconnected, the messages are still in the table waiting to be delivered at next connection.
That is just an option. You need to determine what's best in your workflow.
来源:https://stackoverflow.com/questions/55897522/how-to-do-guaranteed-message-delivery-with-java-client-signalr