Fixed DNS, TCP and UDP on Windows.
All checks were successful
Build & Release / Linux-AMD64-Build (push) Successful in 1m5s
Build & Release / Windows-AMD64-Build (push) Successful in 3m43s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m31s

This commit is contained in:
Arron David Nelson 2024-07-10 02:36:21 -07:00
parent a65c8d64b5
commit 64e1555d56
5 changed files with 13 additions and 16 deletions

View File

@ -122,7 +122,7 @@ set(EHS_SOURCES
src/io/socket/Request.cpp include/ehs/io/socket/Request.h
src/io/socket/Response.cpp include/ehs/io/socket/Response.h
src/io/socket/DNS_LNX.cpp include/ehs/io/socket/DNS_LNX.h
src/io/socket/BaseDNS.cpp include/ehs/io/socket/BaseDNS.h
src/io/socket/BaseUDP.cpp include/ehs/io/socket/BaseUDP.h
src/io/socket/BaseTCP.cpp include/ehs/io/socket/BaseTCP.h
src/io/socket/SSL.cpp include/ehs/io/socket/SSL.h
@ -133,6 +133,7 @@ set(EHS_SOURCES
include/ehs/io/socket/Socket.h
include/ehs/io/socket/TCP.h
include/ehs/io/socket/UDP.h
include/ehs/io/socket/DNS.h
src/io/audio/Audio.cpp include/ehs/io/audio/Audio.h
src/io/audio/BaseAudioDevice.cpp include/ehs/io/audio/BaseAudioDevice.h
@ -176,9 +177,6 @@ set(EHS_SOURCES
include/ehs/io/BaseDirectory.h
src/io/BaseDirectory.cpp
include/ehs/io/Directory.h
include/ehs/io/socket/BaseDNS.h
src/io/socket/BaseDNS.cpp
include/ehs/io/socket/DNS.h
)
if (IS_OS_WINDOWS)

View File

@ -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
{

View File

@ -1,4 +1,8 @@
#include "ehs/io/socket/DNS_W32.h"
#include "ehs/Log.h"
#include <WinSock2.h>
#include <WS2tcpip.h>
namespace ehs
{

View File

@ -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;

View File

@ -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;