59 lines
918 B
C++
59 lines
918 B
C++
#include "ehs/io/socket/BaseUDP.h"
|
|
|
|
namespace ehs
|
|
{
|
|
BaseUDP::BaseUDP()
|
|
: bound(false)
|
|
{
|
|
}
|
|
|
|
BaseUDP::BaseUDP(const IP version)
|
|
: localEndpoint{version, "", 0}, bound(false)
|
|
{
|
|
}
|
|
|
|
BaseUDP::BaseUDP(BaseUDP&& udp) noexcept
|
|
: localEndpoint((Endpoint &&)udp.localEndpoint), bound(true)
|
|
{
|
|
udp.bound = false;
|
|
}
|
|
|
|
BaseUDP::BaseUDP(const BaseUDP& udp)
|
|
: localEndpoint(udp.localEndpoint), bound(false)
|
|
{
|
|
}
|
|
|
|
BaseUDP& BaseUDP::operator=(BaseUDP&& udp) noexcept
|
|
{
|
|
if (this == &udp)
|
|
return *this;
|
|
|
|
localEndpoint = (Endpoint &&)udp.localEndpoint;
|
|
bound = udp.bound;
|
|
|
|
udp.bound = false;
|
|
|
|
return *this;
|
|
}
|
|
|
|
BaseUDP& BaseUDP::operator=(const BaseUDP& udp)
|
|
{
|
|
if (this == &udp)
|
|
return *this;
|
|
|
|
localEndpoint = udp.localEndpoint;
|
|
bound = false;
|
|
|
|
return *this;
|
|
}
|
|
|
|
bool BaseUDP::IsBound() const
|
|
{
|
|
return bound;
|
|
}
|
|
|
|
Endpoint BaseUDP::GetLocalEndpoint() const
|
|
{
|
|
return localEndpoint;
|
|
}
|
|
} |