Fixed SSL and TCP Bind.
This commit is contained in:
@@ -385,6 +385,24 @@ namespace ehs
|
||||
return result;
|
||||
}
|
||||
|
||||
void TCP::SetReuse(const bool &value)
|
||||
{
|
||||
if (!IsValid())
|
||||
{
|
||||
EHS_LOG_INT(LogType::WARN, 1, "Attempted to set address and port reuse while socket is not initialized.");
|
||||
return;
|
||||
}
|
||||
|
||||
const int result = (int)value;
|
||||
if (setsockopt(hdl, SOL_SOCKET, SO_REUSEPORT, &result, sizeof(int)) == -1)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Failed to set address and port reuse with error #" + Str_8::FromNum(errno) + ".");
|
||||
return;
|
||||
}
|
||||
|
||||
EHS_LOG_SUCCESS();
|
||||
}
|
||||
|
||||
bool TCP::IsValid() const
|
||||
{
|
||||
return hdl != EHS_INVALID_SOCKET;
|
||||
|
Reference in New Issue
Block a user