29 #ifdef _WIN32 // Windows specific
30 # include <Ws2tcpip.h>
31 # include <winsock2.h>
34 # pragma comment(lib, "ws2_32.lib")
36 #else // Linux specific
37 # include <arpa/inet.h>
38 # include <netinet/in.h>
39 # include <sys/socket.h>
40 # include <sys/types.h>
44 # define INVALID_SOCKET ((SOCKET)(~0))
45 # define SOCKET_ERROR (-1)
55 int connect(
const std::string& hostname, uint16_t port);
59 int send(
const std::vector<std::uint8_t>& buffer)
override;
60 int recv(std::vector<std::uint8_t>& buffer, std::size_t maxBytesToReceive)
override;
61 int read(std::vector<std::uint8_t>& buffer, std::size_t nBytesToReceive)
override;