added Socket::getIfceIndex(), Socket::getIfceAddress(), etc
This commit is contained in:
@ -24,6 +24,42 @@ static int test1 ()
|
||||
return -1;
|
||||
}
|
||||
|
||||
qse_printf (QSE_T("lo ifindex ===> %d\n"), s.getIfceIndex(QSE_WT("lo")));
|
||||
if (s.getIfceAddress(QSE_WT("lo"), &addr) >= 0)
|
||||
{
|
||||
qse_char_t buf[256];
|
||||
qse_printf (QSE_T("lo ifaddr ===> [%s]\n"), addr.toStrBuf(buf, QSE_COUNTOF(buf)));
|
||||
}
|
||||
if (s.getIfceNetmask(QSE_WT("lo"), &addr) >= 0)
|
||||
{
|
||||
qse_char_t buf[256];
|
||||
qse_printf (QSE_T("lo netmask ===> [%s]\n"), addr.toStrBuf(buf, QSE_COUNTOF(buf)));
|
||||
}
|
||||
if (s.getIfceBroadcast(QSE_WT("lo"), &addr) >= 0)
|
||||
{
|
||||
qse_char_t buf[256];
|
||||
qse_printf (QSE_T("lo broadcast ===> [%s]\n"), addr.toStrBuf(buf, QSE_COUNTOF(buf)));
|
||||
}
|
||||
|
||||
|
||||
qse_printf (QSE_T("eth0 ifindex ===> %d\n"), s.getIfceIndex(QSE_WT("eth0")));
|
||||
if (s.getIfceAddress(QSE_WT("eth0"), &addr) >= 0)
|
||||
{
|
||||
qse_char_t buf[256];
|
||||
qse_printf (QSE_T("eth0 ifaddr ===> [%s]\n"), addr.toStrBuf(buf, QSE_COUNTOF(buf)));
|
||||
}
|
||||
if (s.getIfceNetmask(QSE_WT("eth0"), &addr) >= 0)
|
||||
{
|
||||
qse_char_t buf[256];
|
||||
qse_printf (QSE_T("eth0 netmask ===> [%s]\n"), addr.toStrBuf(buf, QSE_COUNTOF(buf)));
|
||||
}
|
||||
if (s.getIfceBroadcast(QSE_WT("eth0"), &addr) >= 0)
|
||||
{
|
||||
qse_char_t buf[256];
|
||||
qse_printf (QSE_T("eth0 broadcast ===> [%s]\n"), addr.toStrBuf(buf, QSE_COUNTOF(buf)));
|
||||
}
|
||||
|
||||
|
||||
addr.set ("[::1]:9999");
|
||||
s.connect (addr);
|
||||
|
||||
|
Reference in New Issue
Block a user