1 #ifndef UTILMM_SOCKET_HH
2 #define UTILMM_SOCKET_HH
4 #include <boost/noncopyable.hpp>
24 static int to_unix(
Domain d);
25 static int to_unix(
Type t);
27 struct bad_address :
public std::exception { };
33 int wait(
int what, timeval* tv)
const;
36 std::vector<uint8_t>
to_sockaddr(std::string
const& to)
const;
59 void wait(
int what)
const;
88 void connect(std::string
const& to);
95 int read(
void* buf,
size_t size)
const;
102 int write(
void const* buf,
size_t size)
const;
114 void bind(std::string
const& to);
bool try_wait(int what) const
Wait
Definition: socket.hh:21
Type
Definition: socket.hh:20
void bind(std::string const &to)
server_socket(Domain domain, Type type, std::string const &bind_to, int backlog=256)
Domain
Definition: socket.hh:19
std::vector< uint8_t > to_sockaddr(std::string const &to) const
int write(void const *buf, size_t size) const
Definition: socket.hh:109
void connect(std::string const &to)
int read(void *buf, size_t size) const