How can I tell the difference between setting and not setting socket.setKeepAlive ()?

set socket.setKeepAlive (true, 1000) on the client, while the server setting socket.setTimeout (2000) the server still triggers the timeout event? Isn"t the function of setKeepAlive to send packets to the server regularly when there is no data transmission?

May.09,2021

socket.setKeepAlive () means to send an empty packet confirmation if there is no connection at a specified time.

socket.setTimeout () similarly, it will trigger if there is no connection within the specified time, but will not send an empty packet confirmation. Of course, you can send an confirmation packet through the socket in the callback function, which is similar to setKeepAlive. In addition, the timeout event will be triggered.

this is an article I have read before. It is written in great detail. You can take a look at it. Click here

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b488-2c28a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b488-2c28a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?