25#ifndef SFML_UDPSOCKET_HPP
26#define SFML_UDPSOCKET_HPP
31#include <SFML/Network/Export.hpp>
32#include <SFML/Network/Socket.hpp>
33#include <SFML/Network/IpAddress.hpp>
54 MaxDatagramSize = 65507
132 Status send(
const void* data, std::size_t size,
const IpAddress& remoteAddress,
unsigned short remotePort);
155 Status receive(
void* data, std::size_t size, std::size_t& received,
IpAddress& remoteAddress,
unsigned short& remotePort);
197 std::vector<char> m_buffer;
Encapsulate an IPv4 network address.
Utility class to build blocks of data to transfer over the network.
Base class for all the socket types.
Status
Status codes that may be returned by socket functions.
Specialized socket using the UDP protocol.
void unbind()
Unbind the socket from the local port to which it is bound.
Status send(Packet &packet, const IpAddress &remoteAddress, unsigned short remotePort)
Send a formatted packet of data to a remote peer.
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.
UdpSocket()
Default constructor.
Status bind(unsigned short port, const IpAddress &address=IpAddress::Any)
Bind the socket to a specific port.
Status receive(void *data, std::size_t size, std::size_t &received, IpAddress &remoteAddress, unsigned short &remotePort)
Receive raw data from a remote peer.
Status receive(Packet &packet, IpAddress &remoteAddress, unsigned short &remotePort)
Receive a formatted packet of data from a remote peer.