TLSSocket.setKeepAlive method | Node.js tls module | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:tls/
TLSSocket/
setKeepAliveMsetKeepAlive
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:tls/
TLSSocket/
setKeepAliveMsetKeepAlive
method
tls.TLSSocket.setKeepAlivesetKeepAlive(enable?: boolean,initialDelay?: number): this;
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 forinitialDelay will leave the value unchanged from the default (or previous) setting.
Enabling the keep-alive functionality will set the following socket options:
SO_KEEPALIVE=1TCP_KEEPIDLE=initialDelayTCP_KEEPCNT=10TCP_KEEPINTVL=1@returns
The socket itself.
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →