Adjusted workflow.
This commit is contained in:
77
src/io/socket/BaseUDP.cpp
Normal file
77
src/io/socket/BaseUDP.cpp
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user