[英]Send and receive from Socket in Android Java
Hi All I have a small question. 大家好我有一个小问题。
Now my Problem is in client I will be sending data continuously with out caring about acknowledgement example: 现在我的问题是在客户端中,我将继续发送数据而无需关心确认示例:
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?
谁能告诉我一些好的解决方案?
使错误消息包含客户端应重新开始发送的“索引”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.