SpiecsEngine
 
Loading...
Searching...
No Matches

◆ SetReuseAddress()

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

Set socket reuse address option.

Parameters
onTrue if want enable such option.

Definition at line 188 of file Socket.cpp.

189 {
191
192 if(::setsockopt(m_SocketFd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char*>(&on), sizeof(bool)) < 0)
193 {
194 std::stringstream ss;
195 ss << "Socket::SetReuseAddress error, socket fd: " << m_SocketFd << " Error: " << WSAGetLastError();
196
197 SPICES_CORE_CRITICAL(ss.str())
198 }
199 }
#define SPICES_PROFILE_ZONE
SOCKET m_SocketFd
This socket fd.
Definition Socket.h:142