socket.setKeepAlive([enable][, initialDelay])


启用/禁用保持活动功能,并可选择在空闲套接字上发送第一个保持活动探测之前设置初始延迟。

设置 initialDelay(以毫秒为单位)以设置接收到的最后一个数据包和第一个保持活动探测之间的延迟。 将 0 设置为 initialDelay 将使该值与默认(或先前)设置保持不变。

Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket.

Set initialDelay (in milliseconds) to set the delay between the last data packet received and the first keepalive probe. Setting 0 for initialDelay will leave the value unchanged from the default (or previous) setting.