SpiecsEngine
 
Loading...
Searching...
No Matches

◆ SetKeepAlive()

void Spices::Net::Socket::SetKeepAlive ( bool on) const

Set socket keep alive option.

Parameters
onTrue if want enable such option.

Definition at line 175 of file Socket.cpp.

176 {
178
179 if (::setsockopt(m_SocketFd, SOL_SOCKET, SO_KEEPALIVE, reinterpret_cast<const char*>(&on), sizeof(bool)) < 0)
180 {
181 std::stringstream ss;
182 ss << "Socket::SetKeepAlive error, socket fd: " << m_SocketFd << " Error: " << WSAGetLastError();
183
184 SPICES_CORE_CRITICAL(ss.str())
185 }
186 }
#define SPICES_PROFILE_ZONE
SOCKET m_SocketFd
This socket fd.
Definition Socket.h:142