added IFNAMSIZ check in configure.ac
added QSE::SocketAddress::toString() added QSE::Socket::getSendBuf(), QSE::Socket::getRecvBuf()
This commit is contained in:
@ -187,6 +187,18 @@ int Socket::setOption (int level, int optname, const void* optval, qse_sck_len_t
|
||||
return n;
|
||||
}
|
||||
|
||||
int Socket::getSendBuf (unsigned int& size) QSE_CPP_NOEXCEPT
|
||||
{
|
||||
qse_sck_len_t optlen = QSE_SIZEOF(size);
|
||||
return this->getOption(SOL_SOCKET, SO_SNDBUF, (char*)&size, &optlen);
|
||||
}
|
||||
|
||||
int Socket::getRecvBuf (unsigned int& size) QSE_CPP_NOEXCEPT
|
||||
{
|
||||
qse_sck_len_t optlen = QSE_SIZEOF(size);
|
||||
return this->getOption(SOL_SOCKET, SO_RCVBUF, (char*)&size, &optlen);
|
||||
}
|
||||
|
||||
int Socket::setDebug (int n) QSE_CPP_NOEXCEPT
|
||||
{
|
||||
return this->setOption(SOL_SOCKET, SO_DEBUG, (char*)&n, QSE_SIZEOF(n));
|
||||
|
@ -300,6 +300,36 @@ qse_mchar_t* SocketAddress::toStrBuf (qse_mchar_t* buf, qse_size_t len) const QS
|
||||
return buf;
|
||||
}
|
||||
|
||||
QSE::MbString SocketAddress::toMbString (QSE::Mmgr* mmgr) const
|
||||
{
|
||||
QSE::MbString buf(256, mmgr);
|
||||
qse_nwad_t nwad;
|
||||
qse_skadtonwad (&this->skad, &nwad);
|
||||
qse_size_t n = qse_nwadtombs(&nwad, (qse_mchar_t*)buf.getBuffer(), buf.getCapacity(), QSE_NWADTOMBS_ALL);
|
||||
buf.truncate (n);
|
||||
return buf;
|
||||
}
|
||||
|
||||
QSE::WcString SocketAddress::toWcString (QSE::Mmgr* mmgr) const
|
||||
{
|
||||
QSE::WcString buf(256, mmgr);
|
||||
qse_nwad_t nwad;
|
||||
qse_skadtonwad (&this->skad, &nwad);
|
||||
qse_size_t n = qse_nwadtowcs(&nwad, (qse_wchar_t*)buf.getBuffer(), buf.getCapacity(), QSE_NWADTOWCS_ALL);
|
||||
buf.truncate (n);
|
||||
return buf;
|
||||
}
|
||||
|
||||
QSE::String SocketAddress::toString (QSE::Mmgr* mmgr) const
|
||||
{
|
||||
QSE::String buf(256, mmgr);
|
||||
qse_nwad_t nwad;
|
||||
qse_skadtonwad (&this->skad, &nwad);
|
||||
qse_size_t n = qse_nwadtostr(&nwad, (qse_char_t*)buf.getBuffer(), buf.getCapacity(), QSE_NWADTOSTR_ALL);
|
||||
buf.truncate (n);
|
||||
return buf;
|
||||
}
|
||||
|
||||
qse_mchar_t* SocketAddress::ip4addrToStrBuf (const qse_ip4ad_t* ipaddr, qse_mchar_t* buf, qse_size_t len)
|
||||
{
|
||||
qse_nwad_t nwad;
|
||||
|
Reference in New Issue
Block a user