Is TCP server always the subject that sends TCP IP/Keepalive packets?

Asked 2 years ago, Updated 2 years ago, 122 views

If there is no data exchange after the TCP connection is established, the function of sending probe packets and receiving ack to check if the connection is still ongoing is called keepalive.

When there is a TCP Server and there is a TCP Client, does only the server send probe packets?

In the current PC (Client) - Embedded product (Server) configuration, I always checked that the TCP server sends keepalive probe packets, but does the client not send probe packets? Thank you.

tcp

2022-09-22 19:58

1 Answers

Usually, when communicating with sockets, you can specify socket options related to KEEPALIVE, so if a packet does not arrive for a certain period of time (KEEPALIVE TIMER VALUE), you can send it to the server or client. You can specify both the server and the client, or you can specify only one of them, and if you set both, you can only see that the one who set the short timeout is sending a KEEPALIVE.


2022-09-22 19:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.