MCPcopy Create free account
hub / github.com/chen3feng/toft / SetTcpKeepAliveOption

Method SetTcpKeepAliveOption

system/net/socket.cpp:126–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125#if __unix__
126bool Socket::SetTcpKeepAliveOption(int idle, int interval, int count)
127{
128 return
129 SetOption(SOL_SOCKET, SO_KEEPALIVE, 1) &&
130 SetOption(SOL_TCP, TCP_KEEPIDLE, idle) &&
131 SetOption(SOL_TCP, TCP_KEEPINTVL, interval) &&
132 SetOption(SOL_TCP, TCP_KEEPCNT, count);
133}
134#endif
135
136bool Socket::WaitReadable(struct timeval* tv, bool restart)

Callers 1

IoThreadMethod · 0.80

Calls

no outgoing calls

Tested by 1

IoThreadMethod · 0.64