36 #include <sys/socket.h> 71 reinterpret_cast<void*>(&iOption),
74 throw makeException<SocketException>(
"setsockopt SO_REUSEADDR: %s",
83 throw makeException<SocketException>(
"bind: %s",
103 memset(&msg,0,
sizeof(msg));
105 msg.msg_iov =
const_cast<iovec *
>(iov);
106 msg.msg_iovlen = iovcnt;
111 return sendmsg(
iSock_,&msg,flags);
118 return ::recv(
iSock_,buf,len,flags);
126 socklen_t len =
sizeof(addr);
128 if(getsockname(
iSock_, reinterpret_cast<sockaddr*>(&addr), &len))
130 throw makeException<SocketException>(
"getsockname: %s",
139 socklen_t len =
sizeof(addr);
141 if(getsockname(
iSock_, reinterpret_cast<sockaddr*>(&addr), &len))
143 throw makeException<SocketException>(
"getsockname: %s",
socklen_t getAddrLength() const
void open(const INETAddr &address, bool bReuseAddress=false)
sockaddr * getSockAddr() const
ssize_t send(const iovec *iov, int iovcnt, const INETAddr &remoteAddress, int flags=0) const
ssize_t recv(void *buf, size_t len, int flags=0)
INETAddr getLocalAddress() const