Finished implementing, now for the testing phase.

This commit is contained in:
2025-01-26 21:43:17 -08:00
parent 7bc4b9977d
commit 981b40d3b1
47 changed files with 2070 additions and 1597 deletions

View File

@@ -3,25 +3,23 @@
namespace ehs
{
BaseUDP::BaseUDP()
: type(AddrType::IPV6), port(0), bound(false)
: bound(false)
{
}
BaseUDP::BaseUDP(const AddrType type)
: type(type), port(0), bound(false)
BaseUDP::BaseUDP(const IP version)
: localEndpoint{version, "", 0}, bound(false)
{
}
BaseUDP::BaseUDP(BaseUDP&& udp) noexcept
: type(udp.type), address(std::move(udp.address)), port(udp.port), bound(true)
: localEndpoint((Endpoint &&)udp.localEndpoint), bound(true)
{
udp.type = AddrType::IPV6;
udp.port = 0;
udp.bound = false;
}
BaseUDP::BaseUDP(const BaseUDP& udp)
: type(udp.type), address(udp.address), port(udp.port), bound(false)
: localEndpoint(udp.localEndpoint), bound(false)
{
}
@@ -30,13 +28,9 @@ namespace ehs
if (this == &udp)
return *this;
type = udp.type;
address = std::move(udp.address);
port = udp.port;
localEndpoint = (Endpoint &&)udp.localEndpoint;
bound = udp.bound;
udp.type = AddrType::IPV6;
udp.port = 0;
udp.bound = false;
return *this;
@@ -47,9 +41,7 @@ namespace ehs
if (this == &udp)
return *this;
type = udp.type;
address = udp.address;
port = udp.port;
localEndpoint = udp.localEndpoint;
bound = false;
return *this;
@@ -60,18 +52,8 @@ namespace ehs
return bound;
}
AddrType BaseUDP::GetLocalAddressType() const
Endpoint BaseUDP::GetLocalEndpoint() const
{
return type;
}
Str_8 BaseUDP::GetLocalAddress() const
{
return address;
}
UInt_16 BaseUDP::GetLocalPort() const
{
return port;
return localEndpoint;
}
}