#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/openscreen_platform/net_udp_socket.h"
#include <algorithm>
#include <utility>
#include "base/functional/bind.h"
#include "components/openscreen_platform/network_util.h"
#include "net/base/net_errors.h"
namespace openscreen {
ErrorOr<std::unique_ptr<UdpSocket>> UdpSocket::Create(
TaskRunner& task_runner,
Client* client,
const IPEndpoint& local_endpoint) { … }
}
namespace openscreen_platform {
NetUdpSocket::NetUdpSocket(openscreen::UdpSocket::Client* client,
const openscreen::IPEndpoint& local_endpoint)
: … { … }
NetUdpSocket::~NetUdpSocket() = default;
void NetUdpSocket::SendErrorToClient(openscreen::Error::Code openscreen_error,
int net_error) { … }
void NetUdpSocket::DoRead() { … }
bool NetUdpSocket::HandleRecvFromResult(int result) { … }
void NetUdpSocket::OnRecvFromCompleted(int result) { … }
void NetUdpSocket::OnSendToCompleted(int result) { … }
bool NetUdpSocket::IsIPv4() const { … }
bool NetUdpSocket::IsIPv6() const { … }
openscreen::IPEndpoint NetUdpSocket::GetLocalEndpoint() const { … }
void NetUdpSocket::Bind() { … }
void NetUdpSocket::SetMulticastOutboundInterface(
openscreen::NetworkInterfaceIndex ifindex) { … }
void NetUdpSocket::JoinMulticastGroup(
const openscreen::IPAddress& address,
openscreen::NetworkInterfaceIndex ifindex) { … }
void NetUdpSocket::SendMessage(openscreen::ByteView data,
const openscreen::IPEndpoint& dest) { … }
void NetUdpSocket::SetDscp(openscreen::UdpSocket::DscpMode state) { … }
}