14 #ifndef ECL_DEVICES_SOCKET_CLIENT_POS_HPP_
15 #define ECL_DEVICES_SOCKET_CLIENT_POS_HPP_
21 #include <ecl/config/ecl.hpp>
30 #include <arpa/inet.h>
33 #include <sys/ioctl.h>
34 #include <sys/socket.h>
69 SocketClient() : is_open(false), error_handler(
NoError) {};
81 SocketClient(
const std::string &host_name,
const unsigned int &port_number = 5555);
82 virtual ~SocketClient() { close(); }
98 bool open(
const std::string &hostname,
const unsigned int& port_number );
101 bool open()
const {
return is_open; }
114 long write(
const char &c);
124 long write(
const char *s,
unsigned long n);
173 long read(
char *s,
const unsigned long &n);
186 long peek(
char*s,
const unsigned long &n);
191 const Error& error()
const {
return error_handler; }
194 std::string hostname;
210 class is_sink<SocketClient> :
public True {};
218 class is_source<SocketClient> :
public True {};
226 class is_sourcesink<SocketClient> :
public True {};