简体   繁体   中英

C++ How to retrieve ACK from a TCP Socket (windows)

I have some issues getting information about the acknowledgement of a TCP connection.

I've implemented a basic TCP Socket Server (socket(), listen(), bind(), accept(), send()) using Windows sockets. The communication works fine but now I want to retrieve and observe the incoming acknowledgements of the TCP packet.

Does anyone knows how I can get this information programmatically?

If your application needs to know when the data is received, or even in the case of failure, how much was received, you need an application-level acknowledgement.

The TCP ACK does not belong to the Application layer, it is purely layer-4 book-keeping information. If layer7 needs an ACK you need to add one at layer 7.

Related, the same goes for keep-alives: Asyncsockets and "silent" disconnections

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM