25 #ifndef CPP3DS_UDPSOCKET_HPP
26 #define CPP3DS_UDPSOCKET_HPP
31 #include <cpp3ds/Network/Socket.hpp>
122 Status send(
const void* data, std::size_t size,
const IpAddress& remoteAddress,
unsigned short remotePort);
145 Status receive(
void* data, std::size_t size, std::size_t& received,
IpAddress& remoteAddress,
unsigned short& remotePort);
187 std::vector<char> m_buffer;
193 #endif // CPP3DS_UDPSOCKET_HPP
Encapsulate an IPv4 network address.
Specialized socket using the UDP protocol.
Utility class to build blocks of data to transfer over the network.
Base class for all the socket types.
Status bind(unsigned short port)
Bind the socket to a specific port.
unsigned short getLocalPort() const
Get the port to which the socket is bound locally.
Status send(const void *data, std::size_t size, const IpAddress &remoteAddress, unsigned short remotePort)
Send raw data to a remote peer.
Status receive(void *data, std::size_t size, std::size_t &received, IpAddress &remoteAddress, unsigned short &remotePort)
Receive raw data from a remote peer.
void unbind()
Unbind the socket from the local port to which it is bound.
The maximum number of bytes that can be sent in a single UDP datagram.
Status
Status codes that may be returned by socket functions.
UdpSocket()
Default constructor.