10 #ifndef CORAL_NET_UDP_HPP 11 #define CORAL_NET_UDP_HPP 14 # include <winsock2.h> 16 # include <netinet/in.h> 23 #include "coral/config.h" 98 void Send(const
char* buffer,
std::
size_t msgSize);
120 std::
size_t bufferSize,
121 ip::Address* sender);
128 std::unique_ptr<Private> m_private;
133 #endif // header guard An object which represents an internet port number.
Definition: net.hpp:156
BroadcastSocket(const ip::Address &networkInterface, ip::Port port, int flags=0)
Constructor.
std::size_t Receive(char *buffer, std::size_t bufferSize, ip::Address *sender)
Receives a message.
Main module header for coral::net.
Flags
Flags that control the operation of this class.
Definition: udp.hpp:49
void Send(const char *buffer, std::size_t msgSize)
Broadcasts a message.
An object which identifies an internet host or network interface as either an IPv4 address or a textu...
Definition: net.hpp:80
~BroadcastSocket() CORAL_NOEXCEPT
Destructor.
int NativeSocket
The native socket handle type (SOCKET on Windows, int on *NIX).
Definition: udp.hpp:45
Definition: variable_io.hpp:28
NativeSocket NativeHandle() const CORAL_NOEXCEPT
The native socket handle.
Only send, don't receive (i.e., don't bind the socket).
Definition: udp.hpp:56
A class for sending and receiving UDP broadcast messages.
Definition: udp.hpp:38