0

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.

Client c1 send message to Server S1 server send message to the Client2 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.

socket m_Sock;
m_Sock.BeginSend(byteData, 0, byteData.Length, 0, out errCode, SendCallback, null

if error code is success we assume that the message has been successfully sent to this client how ever it does not notify immediately after the connection has been drop, after copule of seconds expected error code get return in this interval we lost messages

if(errCode == SocketError.Success)
bilal
  • 648
  • 8
  • 26
  • 2
    A XMPP server is always able to determine the state of a client by sending a XMPP Ping (XEP-0199) to the client. – Flow Feb 03 '17 at 22:34
  • 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? – bilal Feb 06 '17 at 05:29
  • 1
    I'm not sure if I understood exactly what you are asking, but it appears to me that you want to use XEP-0198 Stream Management. – Flow Feb 06 '17 at 06:41

0 Answers0