Hi All I have a small question.
- I have server client application Where the client will be sending data asynchronously.
- The server will receive message and parse.
- If server receives a wrong data it will send and error message to the client.
Now my Problem is in client I will be sending data continuously with out ca开发者_StackOverflow社区ring about acknowledgement example:
Suppose I am sending some 1000 messages from client. The client sends all the data in the socket.
If error occurs server will also put error message in the socket.
But either one can happen: send data from client or send message from the server.
What is the best way to handle the case?
If any error occurs and client receives the error message from the server then the client has to resend the data. One way is to send the data and wait for acknowledgement. I don't want client to wait for servers ack because chances of error are very less. Can any one tell me some good solution to this?
Have the error message include the 'index' the client should restart sending at.
精彩评论