Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
bilalkhan #1
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
Subject: Reliable Message xmpp
In some of the cases server is not able to determine the state of the client at socket level, some of the time, user is not connected to the server because of connection drop the socket return success. Some of the message get drop, how can we overcome this issue.

c1 send message to S1 server send message to the c2, we can only determine the state of client connection on socket send if it returns success we can assume that the client is alive and the message has been successfully sent. However some time message get drop because the connection was no more and socket is not able to predict? how can overcome this problem.

http://xmpp.org/extensions/xep-0198.html
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This was discussed here several times before. Please use the search and look at those extensions:

  • Keep alive spaces on your sockets to detect disconnects faster
Avatar
bilalkhan #3
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
0184 is about delivery , of client to client status, currently our implementation does not track that the order of delivery, c1 send m1,m2 to c2, c1 recieve a deleivery d2 against m2, m1 is get lost due to internet dis connectivity, server is not able to determine the state immediately.

in this scenario can we assume that the delivery of m1 has not been acknowledged, client c1 again send the messge m1 to m2?

My Question on stack overflow:

http://stackoverflow.com/questions/42021785/reli…?noredi…

ISSUE:

XEP-0199 is implemented in our server, ping pong is separate thread which purely depend on time, If a client is not able to pong in 30 seconds we fetch it's connection and call disconnect function. However, during this time interval their is a risk that the message has been lost. How can we determine the immediate state, on off wife multiple times rapidly, we lost our messages?

XEP-0198 is also implemented in our server.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is how tcp sockets work. There are cases where you can detect a dead connection only when you try to send data.
This is why you should send a whitespace on the server and client side in a specific interval to detect socket loss. We also call them keep alive packets in XMPP.
On top of that you can send XMPP pings with a higher interval.
Avatar
bilalkhan #5
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
OK  i have seen the implementation of agsxmpp keep alive and keep alive interval, i have test the same scenario on whats app on off wifi multiple time rapidly, some of the delivery notification on whats app get missed however all the message get received correctly, we have implemented a trick on every ungraceful termination of connection, we go through the -30 second back from the time of disconnection and resend the message again to the client, irrespective of it is already sent or not, at the client side we put a logic do not show the same message again, same message means do not repeat the same id in a dialogue.


during the time interval of 30 second socket is able to determine the state of the connection, after socket determine the state, we save the onward message in to offline category.

I hope this will save our message from getting lost?
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is not an optimal solution to me.

Take a look at XEP-0198: Stream Management which addresses exactly this problems with acks and fast reconnect.
This post was edited on 2017-02-08, 11:23 by Alex.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS