36 #ifndef RCDISCOVER_SOCKET_WINDOW_H 37 #define RCDISCOVER_SOCKET_WINDOW_H 83 ULONG dst_ip, uint16_t port,
84 std::string iface_name);
106 void bindImpl(
const sockaddr_in &addr);
112 void sendImpl(
const std::vector<uint8_t> &sendbuf);
131 #endif //RCDISCOVER_SOCKET_WINDOW_H
SocketWindows & operator=(SocketWindows &&other)
void bindImpl(const sockaddr_in &addr)
Binds the socket to a specific sockaddr.
void enableNonBlockingImpl()
Enables non-blocking operation for this socket.
static std::vector< SocketWindows > createAndBindForAllInterfaces(uint16_t port)
Creates sockets for all interfaces and binds them to the respective interface.
static const ULONG & getBroadcastAddr()
Returns the broadcast address.
CRTP class for platform specific socket implementation.
void enableBroadcastImpl()
Enables broadcast for this socket.
static SocketWindows create(ULONG dst_ip, uint16_t port, std::string iface_name)
Create a new socket.
SocketWindows(int domain, int type, int protocol, ULONG dst_ip, uint16_t port, std::string iface_name)
Constructor.
void sendImpl(const std::vector< uint8_t > &sendbuf)
Sends data.
SOCKET SocketType
Type representing the native socket handle type.
const SOCKET & getHandleImpl() const
Returns the native socket handle.