How to get an acknowledgement for the client socke

2019-02-16 05:41发布

问题:

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.

回答1:

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.