Enables TCP keepalives.
SDKs
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
- watchOS 5.0+
Framework
- Network
Declaration
void nw_tcp_options_set_enable_keepalive(nw _protocol _options _t options, bool enable_keepalive);
Enables TCP keepalives.
SDKs
Framework
void nw_tcp_options_set_enable_keepalive(nw _protocol _options _t options, bool enable_keepalive);
nw _tcp _options _set _keepalive _idle _time
Sets the number of seconds of idleness that TCP waits before sending keepalive probes.
nw _tcp _options _set _keepalive _count
Sets the number of keepalive probes that TCP sends before terminating the connection.
nw _tcp _options _set _keepalive _interval
Sets the number of seconds that TCP waits between sending keepalive probes.