This commit is contained in:
2025-01-29 16:21:11 -08:00
parent 39bbcd0d56
commit 62f8a662a0
7 changed files with 52 additions and 38 deletions

View File

@@ -90,9 +90,9 @@ namespace ehs
return;
}
if (IP == IP::V6)
if (ip == IP::V6)
hdl = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
else if (IP == IP::V4)
else if (ip == IP::V4)
hdl = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
else
return;
@@ -142,9 +142,9 @@ namespace ehs
if (!IsValid() || bound || connection)
return;
if (IP == IP::V6)
if (ip == IP::V6)
Bind_v6(address, port);
else if (IP == IP::V4)
else if (ip == IP::V4)
Bind_v4(address, port);
this->localAddr = address;
@@ -178,7 +178,7 @@ namespace ehs
UInt_32 addrLen = sizeof(sockaddr_in6);
TCP* client = new TCP();
client->IP = IP;
client->ip = ip;
client->localAddr = localAddr;
client->localPort = localPort;
client->connection = true;
@@ -244,7 +244,7 @@ namespace ehs
remoteHostName = address;
remotePort = port;
if (IP == IP::V6)
if (ip == IP::V6)
{
if (IsIPv6Only())
remoteAddr = DNS::Resolve(IP::V6, address);
@@ -253,7 +253,7 @@ namespace ehs
Connect_v6(remoteAddr, port);
}
else if (IP == IP::V4)
else if (ip == IP::V4)
{
remoteAddr = DNS::Resolve(IP::V4, address);
@@ -359,7 +359,7 @@ namespace ehs
void TCP::SetIPv6Only(const bool value)
{
if (IP != IP::V6)
if (ip != IP::V6)
{
EHS_LOG_INT(LogType::WARN, 0, "Cannot set IPv6 only mode while socket is not using IPv6.");
return;
@@ -383,7 +383,7 @@ namespace ehs
bool TCP::IsIPv6Only() const
{
if (IP != IP::V6)
if (ip != IP::V6)
return false;
if (!IsValid())