7 #ifndef NAZARA_UDPSOCKET_HPP 8 #define NAZARA_UDPSOCKET_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Network/AbstractSocket.hpp> 12 #include <Nazara/Network/IpAddress.hpp> 27 inline SocketState Bind(UInt16 port);
28 SocketState Bind(
const IpAddress& address);
30 inline bool Create(NetProtocol protocol);
32 void EnableBroadcasting(
bool broadcasting);
35 inline UInt16 GetBoundPort()
const;
37 inline bool IsBroadcastingEnabled()
const;
39 std::size_t QueryMaxDatagramSize();
41 bool Receive(
void* buffer, std::size_t size,
IpAddress* from, std::size_t* received);
42 bool ReceiveMultiple(NetBuffer* buffers, std::size_t bufferCount,
IpAddress* from, std::size_t* received);
45 bool Send(
const IpAddress& to,
const void* buffer, std::size_t size, std::size_t* sent);
46 bool SendMultiple(
const IpAddress& to,
const NetBuffer* buffers, std::size_t bufferCount, std::size_t* sent);
50 void OnClose()
override;
51 void OnOpened()
override;
54 bool m_isBroadCastingEnabled;
58 #include <Nazara/Network/UdpSocket.inl> 60 #endif // NAZARA_UDPSOCKET_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Network class that represents an IP address.
Definition: IpAddress.hpp:21
Network class that represents a packet.
Definition: NetPacket.hpp:18
Network class that represents a UDP socket, allowing for sending/receiving datagrams.
Definition: UdpSocket.hpp:19
Network class that represents the base of socket.
Definition: AbstractSocket.hpp:18