Fixed DNS, TCP and UDP on Windows.
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
#include "ehs/io/socket/DNS_LNX.h"
|
||||
#include "ehs/Log.h"
|
||||
|
||||
#if defined(EHS_OS_WINDOWS)
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
#elif defined(EHS_OS_LINUX)
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
|
@@ -1,4 +1,8 @@
|
||||
#include "ehs/io/socket/DNS_W32.h"
|
||||
#include "ehs/Log.h"
|
||||
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
|
@@ -372,7 +372,7 @@ namespace ehs
|
||||
}
|
||||
|
||||
const int result = (int)value;
|
||||
if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, sizeof(int)) == -1)
|
||||
if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&result, sizeof(int)) == -1)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + ".");
|
||||
return;
|
||||
@@ -395,7 +395,7 @@ namespace ehs
|
||||
int result;
|
||||
socklen_t len = sizeof(int);
|
||||
|
||||
if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, &len) == -1)
|
||||
if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&result, &len) == -1)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + ".");
|
||||
return false;
|
||||
|
@@ -238,7 +238,7 @@ namespace ehs
|
||||
}
|
||||
|
||||
const int result = (int)value;
|
||||
if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, sizeof(int)) == -1)
|
||||
if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&result, sizeof(int)) == -1)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + ".");
|
||||
return;
|
||||
@@ -261,7 +261,7 @@ namespace ehs
|
||||
int result;
|
||||
socklen_t len = sizeof(int);
|
||||
|
||||
if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, &len) == -1)
|
||||
if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&result, &len) == -1)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + ".");
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user