22 #include <sys/socket.h> 23 #include <sys/types.h> 31 struct sockaddr * addr,
34 if (::getsockname(handle.
fd(),addr,len) < 0)
39 struct sockaddr * addr,
42 if (::getpeername(handle.
fd(),addr,len) < 0)
47 struct sockaddr
const * addr,
50 if (::bind(handle.
fd(),addr,len) < 0)
55 struct sockaddr
const * addr,
64 socklen_t len =
sizeof(err);
65 if (::getsockopt(handle.
fd(),SOL_SOCKET,SO_ERROR,&err,&len) < 0)
#define SENF_THROW_SYSTEM_EXCEPTION(desc)
static void do_local(FileHandle const &handle, struct sockaddr *addr, socklen_t *len)
static void do_peer(FileHandle const &handle, struct sockaddr *addr, socklen_t *len)
static void do_connect(FileHandle const &handle, struct sockaddr const *addr, socklen_t len)
bool waitWriteable(senf::ClockService::clock_type timeout=senf::ClockService::clock_type(-1)) const
Wait, until a write on the handle would not block (ignoring blocking state)
Basic file handle wrapper.
void connect(connector::FastActiveOutput< PacketType > &source, connector::FastPassiveInput< PacketType > &target)
int fd() const
Return the raw FileHandle.
#define SENF_EXC_DEBUGINFO
BSDAddressingPolicyMixin public header.
static void do_bind(FileHandle const &handle, struct sockaddr const *addr, socklen_t len)