21 #include <sys/socket.h> 22 #include <sys/types.h> 37 virtual bool open(
int socket_fd,
struct sockaddr* address,
size_t address_len)
39 return ::connect(socket_fd, address, address_len) == 0;
43 URStream(std::string& host,
int port) : host_(host), port_(port)
62 bool read(uint8_t* buf,
size_t buf_len,
size_t&
read);
63 bool write(
const uint8_t* buf,
size_t buf_len,
size_t& written);
virtual bool open(int socket_fd, struct sockaddr *address, size_t address_len)
URStream(std::string &host, int port)
#define LOG_INFO(format,...)
bool setup(std::string &host, int port)
bool read(uint8_t *buf, size_t buf_len, size_t &read)
bool write(const uint8_t *buf, size_t buf_len, size_t &written)