25#ifndef SFML_SOCKETUDP_HPP
26#define SFML_SOCKETUDP_HPP
72 bool Bind(
unsigned short Port);
217 unsigned short myPort;
218 Uint32 myPendingHeader;
219 Uint32 myPendingHeaderSize;
220 std::vector<char> myPendingPacket;
221 Int32 myPendingPacketSize;
IPAddress provides easy manipulation of IP v4 addresses.
Packet wraps data to send / to receive through the network.
Selector allow reading from multiple sockets without blocking.
unsigned short GetPort() const
Get the port the socket is currently bound to.
void SetBlocking(bool Blocking)
Change the blocking state of the socket.
Socket::Status Receive(Packet &PacketToReceive, IPAddress &Address, unsigned short &Port)
Receive a packet.
bool Bind(unsigned short Port)
Bind the socket to a specific port.
bool Unbind()
Unbind the socket from its previous port, if any.
SocketUDP()
Default constructor.
bool IsValid() const
Check if the socket is in a valid state ; this function can be called any time to check if the socket...
Socket::Status Send(const char *Data, std::size_t Size, const IPAddress &Address, unsigned short Port)
Send an array of bytes.
Socket::Status Receive(char *Data, std::size_t MaxSize, std::size_t &SizeReceived, IPAddress &Address, unsigned short &Port)
Receive an array of bytes.
bool Close()
Close the socket.
Socket::Status Send(Packet &PacketToSend, const IPAddress &Address, unsigned short Port)
Send a packet of data.
Status
Enumeration of status returned by socket functions.