Fixed UDP/TCP sockets and documented BaseObj class.

This commit is contained in:
2024-02-01 19:56:06 -08:00
parent c2cbb35cdf
commit 227188243e
6 changed files with 55 additions and 33 deletions

View File

@@ -114,7 +114,7 @@ namespace ehs
hdl = EHS_INVALID_SOCKET;
}
void TCP::Bind(const Str_8& address, unsigned short port)
void TCP::Bind(const Str_8& address, UInt_16 port)
{
if (!IsValid() || bound || connection)
return;
@@ -207,7 +207,7 @@ namespace ehs
return client;
}
void TCP::Connect(const Str_8& address, const unsigned short port)
void TCP::Connect(const Str_8& address, const UInt_16 port)
{
if (connection || !IsValid() || listening)
return;
@@ -331,7 +331,7 @@ namespace ehs
return hdl != EHS_INVALID_SOCKET;
}
void TCP::Bind_v6(const Str_8& address, unsigned short port)
void TCP::Bind_v6(const Str_8& address, UInt_16 port)
{
sockaddr_in6 result = {};
result.sin6_family = AF_INET6;
@@ -367,7 +367,7 @@ namespace ehs
}
}
void TCP::Bind_v4(const Str_8& address, unsigned short port)
void TCP::Bind_v4(const Str_8& address, UInt_16 port)
{
sockaddr_in result = {};
result.sin_family = AF_INET;
@@ -402,7 +402,7 @@ namespace ehs
}
}
void TCP::Connect_v6(const Str_8& address, unsigned short port)
void TCP::Connect_v6(const Str_8& address, UInt_16 port)
{
sockaddr_in6 result = {};
result.sin6_family = AF_INET6;
@@ -439,7 +439,7 @@ namespace ehs
}
}
void TCP::Connect_v4(const Str_8& address, unsigned short port)
void TCP::Connect_v4(const Str_8& address, UInt_16 port)
{
sockaddr_in result = {};
result.sin_family = AF_INET;

View File

@@ -137,7 +137,7 @@ namespace ehs
connected = false;
}
void TCP::Bind(const Str_8& address, unsigned short port)
void TCP::Bind(const Str_8& address, UInt_16 port)
{
if (!IsValid() || bound || connection)
return;
@@ -236,7 +236,7 @@ namespace ehs
return client;
}
void TCP::Connect(const Str_8& address, const unsigned short port)
void TCP::Connect(const Str_8& address, const UInt_16 port)
{
if (connection || !IsValid() || listening)
return;
@@ -352,7 +352,7 @@ namespace ehs
return hdl != EHS_INVALID_SOCKET;
}
void TCP::Bind_v6(const Str_8& address, unsigned short port)
void TCP::Bind_v6(const Str_8& address, UInt_16 port)
{
sockaddr_in6 result = {};
result.sin6_family = AF_INET6;
@@ -388,7 +388,7 @@ namespace ehs
}
}
void TCP::Bind_v4(const Str_8& address, unsigned short port)
void TCP::Bind_v4(const Str_8& address, UInt_16 port)
{
sockaddr_in result = {};
result.sin_family = AF_INET;
@@ -424,7 +424,7 @@ namespace ehs
}
}
void TCP::Connect_v6(const Str_8& address, unsigned short port)
void TCP::Connect_v6(const Str_8& address, UInt_16 port)
{
sockaddr_in6 result = {};
result.sin6_family = AF_INET6;
@@ -461,7 +461,7 @@ namespace ehs
}
}
void TCP::Connect_v4(const Str_8& address, unsigned short port)
void TCP::Connect_v4(const Str_8& address, UInt_16 port)
{
sockaddr_in result = {};
result.sin_family = AF_INET;