Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
150 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...