Skip to content

Commit e0814bc

Browse files
committed
doc: better examples
1 parent 288a6eb commit e0814bc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

doc/api/net.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,8 +1402,9 @@ data packet received and the first keepalive probe. Setting `0` for
14021402
`initialDelay` will leave the value unchanged from the default
14031403
(or previous) setting.
14041404

1405-
**Note:** Node.js converts `initialDelay` from milliseconds to seconds and truncates any fractional part.
1406-
For example, `1500` becomes `1`, and values from `1` to `999` become `0`.
1405+
**Note**: Node.js converts initialDelay from milliseconds to seconds and truncates any fractional part.
1406+
For example, `setKeepAlive(true, 500)` does not update the delay because it is truncated to `0`, leaving the value
1407+
unchanged, while `setKeepAlive(true, 1500)` sets it to `1` second.
14071408

14081409
Enabling the keep-alive functionality will set the following socket options:
14091410

0 commit comments

Comments
 (0)