25 #ifndef SFML_UDPSOCKET_H
26 #define SFML_UDPSOCKET_H
206 #endif // SFML_UDPSOCKET_H
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket *socket, sfPacket *packet, sfIpAddress *address, unsigned short *port)
Receive a formatted packet of data from a remote peer with a UDP socket.
CSFML_NETWORK_API void sfUdpSocket_destroy(sfUdpSocket *socket)
Destroy a UDP socket.
#define CSFML_NETWORK_API
CSFML_NETWORK_API void sfUdpSocket_setBlocking(sfUdpSocket *socket, sfBool blocking)
Set the blocking state of a UDP listener.
CSFML_NETWORK_API sfUdpSocket * sfUdpSocket_create(void)
Create a new UDP socket.
struct sfUdpSocket sfUdpSocket
Encapsulate an IPv4 network address.
CSFML_NETWORK_API sfBool sfUdpSocket_isBlocking(const sfUdpSocket *socket)
Tell whether a UDP socket is in blocking or non-blocking mode.
CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket *socket)
Get the port to which a UDP socket is bound locally.
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket *socket, unsigned short port)
Bind a UDP socket to a specific port.
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket *socket, sfPacket *packet, sfIpAddress address, unsigned short port)
Send a formatted packet of data to a remote peer with a UDP socket.
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket *socket, const void *data, size_t size, sfIpAddress address, unsigned short port)
Send raw data to a remote peer with a UDP socket.
CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize()
Return the maximum number of bytes that can be sent in a single UDP datagram.
CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket *socket)
Unbind a UDP socket from the local port to which it is bound.
sfSocketStatus
Define the status that can be returned by the socket functions.
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket *socket, void *data, size_t maxSize, size_t *sizeReceived, sfIpAddress *address, unsigned short *port)
Receive raw data from a remote peer with a UDP socket.