socklen_t len = sizeof(ling);
::memset(&ling,sizeof(ling),0);
if (::getsockopt(body().fd(),SOL_SOCKET,SO_LINGER,&ling,&len) < 0)
- throw SystemException(errno);
+ throwErrno();
return std::make_pair(ling.l_onoff, ling.l_linger);
}
ling.l_onoff = enable;
ling.l_linger = timeout;
if (::setsockopt(body().fd(),SOL_SOCKET,SO_LINGER,&ling,sizeof(ling)) < 0)
- throw SystemException(errno);
+ throwErrno();
}
prefix_ struct timeval senf::BSDSocketProtocol::timestamp()
{
struct timeval tv;
if (::ioctl(body().fd(), SIOCGSTAMP, &tv) < 0)
- throw SystemException(errno);
+ throwErrno();
return tv;
}
int value;
socklen_t len (sizeof(value));
if (::getsockopt(body().fd(),SOL_SOCKET,SO_REUSEADDR,&value,&len) < 0)
- throw SystemException(errno);
+ throwErrno();
return value;
}
{
int ivalue (value);
if (::setsockopt(body().fd(),SOL_SOCKET,SO_REUSEADDR,&ivalue,sizeof(ivalue)) < 0)
- throw SystemException(errno);
+ throwErrno();
}
///////////////////////////////cc.e////////////////////////////////////////