36 #ifndef RCDISCOVER_SOCKET_H 37 #define RCDISCOVER_SOCKET_H 51 template<
typename Derived>
57 return *
static_cast<Derived *
>(
this);
62 return *
static_cast<const Derived *
>(
this);
89 void bind(
const sockaddr_in& addr)
98 void send(
const std::vector<uint8_t>& sendbuf)
133 #endif //RCDISCOVER_SOCKET_H const std::string & getIfaceName() const
Returns the interface name.
Socket & operator=(const Socket &)=delete
void enableNonBlocking()
Enables non-blocking operation for this socket.
CRTP class for platform specific socket implementation.
void enableBroadcast()
Enables broadcast for this socket.
void bind(const sockaddr_in &addr)
Binds the socket to an interface.
const Derived & getDerived() const
void send(const std::vector< uint8_t > &sendbuf)
Sends data.
Socket(std::string iface_name)
const T & getHandle() const
Returns the native socket handle.