如何从服务器获取客户端套接字的确认? [英] How to get an acknowledgement for the client socket from server?

查看:439
本文介绍了如何从服务器获取客户端套接字的确认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端套接字,它向服务器发送消息。我想在服务器收到消息时在客户端获得确认。是否有可能获得该确认。我使用apache mina开发了客户端。在此先感谢。

I have a client socket which sends messages to the server.I want to get an acknowledgement on the client side whenever the server receives the message. Is it possible to get that acknowledgement. I developed the client using apache mina. Thanks in advance.

推荐答案

TCP中没有消息,只有一个字节流。有一个内部ACK机制可以跟踪已正确接收的流量,但应用程序无法使用。如果您需要来自服务器的确认,您的服务器必须发送它。

There are no messages in TCP, only a byte stream. There is an internal ACK mechanism that tracks how much of the stream has been correctly received, but it is not available to applications. If you want an acknowledgment from the server, your server will have to send it.

这篇关于如何从服务器获取客户端套接字的确认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆