Adjusted workflow.
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m8s
Build & Release / Linux-AMD64-Build (push) Successful in 1m30s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m21s

This commit is contained in:
2024-02-05 22:25:30 -08:00
commit bcd71cf2b5
251 changed files with 45909 additions and 0 deletions

77
src/io/socket/BaseUDP.cpp Normal file
View File

@@ -0,0 +1,77 @@
#include "ehs/io/socket/BaseUDP.h"
namespace ehs
{
BaseUDP::BaseUDP()
: type(AddrType::IPV6), port(0), bound(false)
{
}
BaseUDP::BaseUDP(const AddrType type)
: type(type), port(0), bound(false)
{
}
BaseUDP::BaseUDP(BaseUDP&& udp) noexcept
: type(udp.type), address(std::move(udp.address)), port(udp.port), 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)
{
}
BaseUDP& BaseUDP::operator=(BaseUDP&& udp) noexcept
{
if (this == &udp)
return *this;
type = udp.type;
address = std::move(udp.address);
port = udp.port;
bound = udp.bound;
udp.type = AddrType::IPV6;
udp.port = 0;
udp.bound = false;
return *this;
}
BaseUDP& BaseUDP::operator=(const BaseUDP& udp)
{
if (this == &udp)
return *this;
type = udp.type;
address = udp.address;
port = udp.port;
bound = false;
return *this;
}
bool BaseUDP::IsBound() const
{
return bound;
}
AddrType BaseUDP::GetLocalAddressType() const
{
return type;
}
Str_8 BaseUDP::GetLocalAddress() const
{
return address;
}
UInt_16 BaseUDP::GetLocalPort() const
{
return port;
}
}