mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-16 18:56:52 +02:00
integrated changes from 1.3.5
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// DNS.cpp
|
// DNS.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/DNS.cpp#10 $
|
// $Id: //poco/Main/Net/src/DNS.cpp#11 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: NetCore
|
// Package: NetCore
|
||||||
@@ -137,6 +137,7 @@ HostEntry DNS::hostByAddress(const IPAddress& address)
|
|||||||
struct addrinfo* pAI;
|
struct addrinfo* pAI;
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
hints.ai_flags = AI_CANONNAME;
|
||||||
if (getaddrinfo(fqname, NULL, &hints, &pAI) == 0)
|
if (getaddrinfo(fqname, NULL, &hints, &pAI) == 0)
|
||||||
{
|
{
|
||||||
std::pair<DNSCache::iterator, bool> res = _cache.insert(std::pair<std::string, HostEntry>(std::string(fqname), HostEntry(pAI)));
|
std::pair<DNSCache::iterator, bool> res = _cache.insert(std::pair<std::string, HostEntry>(std::string(fqname), HostEntry(pAI)));
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// HostEntry.cpp
|
// HostEntry.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/HostEntry.cpp#9 $
|
// $Id: //poco/Main/Net/src/HostEntry.cpp#10 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: NetCore
|
// Package: NetCore
|
||||||
@@ -92,15 +92,15 @@ HostEntryImpl::HostEntryImpl(struct addrinfo* ainfo)
|
|||||||
{
|
{
|
||||||
_name.assign(ai->ai_canonname);
|
_name.assign(ai->ai_canonname);
|
||||||
}
|
}
|
||||||
else if (ai->ai_addrlen && ai->ai_addr)
|
if (ai->ai_addrlen && ai->ai_addr)
|
||||||
{
|
{
|
||||||
switch (ai->ai_addr->sa_family)
|
switch (ai->ai_addr->sa_family)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
_addresses.push_back(IPAddress(&reinterpret_cast<struct sockaddr_in*>(&ai->ai_addr)->sin_addr, sizeof(in_addr)));
|
_addresses.push_back(IPAddress(&reinterpret_cast<struct sockaddr_in*>(ai->ai_addr)->sin_addr, sizeof(in_addr)));
|
||||||
break;
|
break;
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
_addresses.push_back(IPAddress(&reinterpret_cast<struct sockaddr_in6*>(&ai->ai_addr)->sin6_addr, sizeof(in6_addr)));
|
_addresses.push_back(IPAddress(&reinterpret_cast<struct sockaddr_in6*>(ai->ai_addr)->sin6_addr, sizeof(in6_addr)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// IPAddress.cpp
|
// IPAddress.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/IPAddress.cpp#21 $
|
// $Id: //poco/Main/Net/src/IPAddress.cpp#22 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: NetCore
|
// Package: NetCore
|
||||||
@@ -175,9 +175,9 @@ public:
|
|||||||
bool isSiteLocal() const
|
bool isSiteLocal() const
|
||||||
{
|
{
|
||||||
UInt32 addr = ntohl(_addr.s_addr);
|
UInt32 addr = ntohl(_addr.s_addr);
|
||||||
return (addr & 0xFF000000) == 0x0A000000 || // 10.0.0.0/24
|
return (addr & 0xFF000000) == 0x0A000000 || // 10.0.0.0/24
|
||||||
(addr & 0xFFFF0000) == 0xC0A80000 || // 192.68.0.0/16
|
(addr & 0xFFFF0000) == 0xC0A80000 || // 192.68.0.0/16
|
||||||
addr >= 0xAC100000 && addr <= 0xAC1FFFFF; // 172.16.0.0 to 172.31.255.255
|
(addr >= 0xAC100000 && addr <= 0xAC1FFFFF); // 172.16.0.0 to 172.31.255.255
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isIPv4Compatible() const
|
bool isIPv4Compatible() const
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// MulticastSocket.cpp
|
// MulticastSocket.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/svn/Net/src/MulticastSocket.cpp#2 $
|
// $Id: //poco/Main/Net/src/MulticastSocket.cpp#13 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: Sockets
|
// Package: Sockets
|
||||||
@@ -43,9 +43,11 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
#if defined(hpux) && defined(_XOPEN_SOURCE_EXTENDED)
|
#if defined(hpux) && defined(_XOPEN_SOURCE_EXTENDED) && defined(POCO_HPUX_IP_MREQ_HACK)
|
||||||
// netinet/in.h does not define struct ip_mreq if
|
// netinet/in.h does not define struct ip_mreq if
|
||||||
// _XOPEN_SOURCE_EXTENDED is #define'd.
|
// _XOPEN_SOURCE_EXTENDED is #define'd in HP-UX 11.x
|
||||||
|
// versions prior to 11.30. Compile with -DPOCO_HPUX_IP_MREQ_HACK
|
||||||
|
// if you experience problems.
|
||||||
struct ip_mreq
|
struct ip_mreq
|
||||||
{
|
{
|
||||||
struct in_addr imr_multiaddr;
|
struct in_addr imr_multiaddr;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// NetworkInterface.cpp
|
// NetworkInterface.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#23 $
|
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#24 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: Sockets
|
// Package: Sockets
|
||||||
@@ -296,7 +296,7 @@ NetworkInterface NetworkInterface::forName(const std::string& name, bool require
|
|||||||
NetworkInterfaceList ifs = list();
|
NetworkInterfaceList ifs = list();
|
||||||
for (NetworkInterfaceList::const_iterator it = ifs.begin(); it != ifs.end(); ++it)
|
for (NetworkInterfaceList::const_iterator it = ifs.begin(); it != ifs.end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->name() == name && it->supportsIPv6() == requireIPv6)
|
if (it->name() == name && ((requireIPv6 && it->supportsIPv6()) || !requireIPv6))
|
||||||
return *it;
|
return *it;
|
||||||
}
|
}
|
||||||
throw InterfaceNotFoundException(name);
|
throw InterfaceNotFoundException(name);
|
||||||
@@ -389,7 +389,7 @@ NetworkInterface::NetworkInterfaceList NetworkInterface::list()
|
|||||||
pAdapterAddresses = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(new char[addrLen]);
|
pAdapterAddresses = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(new char[addrLen]);
|
||||||
// Make an initial call to GetAdaptersAddresses to get
|
// Make an initial call to GetAdaptersAddresses to get
|
||||||
// the necessary size into addrLen
|
// the necessary size into addrLen
|
||||||
rc = GetAdaptersAddresses(AF_INET6, 0, 0, pAdapterAddresses, &addrLen);
|
rc = GetAdaptersAddresses(AF_UNSPEC, 0, 0, pAdapterAddresses, &addrLen);
|
||||||
if (rc == ERROR_BUFFER_OVERFLOW)
|
if (rc == ERROR_BUFFER_OVERFLOW)
|
||||||
{
|
{
|
||||||
delete [] reinterpret_cast<char*>(pAdapterAddresses);
|
delete [] reinterpret_cast<char*>(pAdapterAddresses);
|
||||||
@@ -401,14 +401,23 @@ NetworkInterface::NetworkInterfaceList NetworkInterface::list()
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (GetAdaptersAddresses(AF_INET6, 0, 0, pAdapterAddresses, &addrLen) == NO_ERROR)
|
if (GetAdaptersAddresses(AF_UNSPEC, 0, 0, pAdapterAddresses, &addrLen) == NO_ERROR)
|
||||||
{
|
{
|
||||||
pAddress = pAdapterAddresses;
|
pAddress = pAdapterAddresses;
|
||||||
while (pAddress)
|
while (pAddress)
|
||||||
{
|
{
|
||||||
if (pAddress->FirstUnicastAddress)
|
if (pAddress->FirstUnicastAddress)
|
||||||
{
|
{
|
||||||
IPAddress addr(pAddress->FirstUnicastAddress->Address.lpSockaddr, pAddress->FirstUnicastAddress->Address.iSockaddrLength);
|
IPAddress addr;
|
||||||
|
switch (pAddress->FirstUnicastAddress->Address.lpSockaddr->sa_family)
|
||||||
|
{
|
||||||
|
case AF_INET:
|
||||||
|
addr = IPAddress(&reinterpret_cast<struct sockaddr_in*>(pAddress->FirstUnicastAddress->Address.lpSockaddr)->sin_addr, sizeof(in_addr));
|
||||||
|
break;
|
||||||
|
case AF_INET6:
|
||||||
|
addr = IPAddress(&reinterpret_cast<struct sockaddr_in6*>(pAddress->FirstUnicastAddress->Address.lpSockaddr)->sin6_addr, sizeof(in6_addr));
|
||||||
|
break;
|
||||||
|
}
|
||||||
std::string name(pAddress->AdapterName);
|
std::string name(pAddress->AdapterName);
|
||||||
std::string displayName;
|
std::string displayName;
|
||||||
#ifdef POCO_WIN32_UTF8
|
#ifdef POCO_WIN32_UTF8
|
||||||
@@ -431,6 +440,7 @@ NetworkInterface::NetworkInterfaceList NetworkInterface::list()
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
delete [] reinterpret_cast<char*>(pAdapterAddresses);
|
delete [] reinterpret_cast<char*>(pAdapterAddresses);
|
||||||
|
return result;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add IPv4 loopback interface (not returned by GetAdaptersInfo)
|
// Add IPv4 loopback interface (not returned by GetAdaptersInfo)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// StreamSocketImpl.cpp
|
// StreamSocketImpl.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/StreamSocketImpl.cpp#9 $
|
// $Id: //poco/Main/Net/src/StreamSocketImpl.cpp#10 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: Sockets
|
// Package: Sockets
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Poco/Net/StreamSocketImpl.h"
|
#include "Poco/Net/StreamSocketImpl.h"
|
||||||
|
#include "Poco/Exception.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -54,7 +55,7 @@ StreamSocketImpl::StreamSocketImpl(IPAddress::Family family)
|
|||||||
else if (family == IPAddress::IPv6)
|
else if (family == IPAddress::IPv6)
|
||||||
init(AF_INET6);
|
init(AF_INET6);
|
||||||
#endif
|
#endif
|
||||||
else throw InvalidArgumentException("Invalid or unsupported address family passed to StreamSocketImpl");
|
else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to StreamSocketImpl");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// DNSTest.cpp
|
// DNSTest.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/svn/Net/testsuite/src/DNSTest.cpp#2 $
|
// $Id: //poco/Main/Net/testsuite/src/DNSTest.cpp#8 $
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
@@ -61,10 +61,13 @@ void DNSTest::testHostByName()
|
|||||||
{
|
{
|
||||||
HostEntry he1 = DNS::hostByName("www.appinf.com");
|
HostEntry he1 = DNS::hostByName("www.appinf.com");
|
||||||
assert (he1.name() == "appinf.com");
|
assert (he1.name() == "appinf.com");
|
||||||
|
#if !defined(_WIN32) && !defined(POCO_HAVE_IPv6)
|
||||||
|
// getaddrinfo() does not report any aliases
|
||||||
assert (!he1.aliases().empty());
|
assert (!he1.aliases().empty());
|
||||||
assert (he1.aliases()[0] == "www.appinf.com");
|
assert (he1.aliases()[0] == "www.appinf.com");
|
||||||
|
#endif
|
||||||
assert (he1.addresses().size() == 1);
|
assert (he1.addresses().size() == 1);
|
||||||
assert (he1.addresses()[0].toString() == "213.229.60.82");
|
assert (he1.addresses()[0].toString() == "216.146.46.35");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -82,12 +85,12 @@ void DNSTest::testHostByName()
|
|||||||
|
|
||||||
void DNSTest::testHostByAddress()
|
void DNSTest::testHostByAddress()
|
||||||
{
|
{
|
||||||
IPAddress ip1("213.229.60.82");
|
IPAddress ip1("216.146.46.35");
|
||||||
HostEntry he1 = DNS::hostByAddress(ip1);
|
HostEntry he1 = DNS::hostByAddress(ip1);
|
||||||
assert (he1.name() == "quentin.inode.at");
|
assert (he1.name() == "web.appinf.com");
|
||||||
assert (he1.aliases().empty());
|
assert (he1.aliases().empty());
|
||||||
assert (he1.addresses().size() == 1);
|
assert (he1.addresses().size() == 1);
|
||||||
assert (he1.addresses()[0].toString() == "213.229.60.82");
|
assert (he1.addresses()[0].toString() == "216.146.46.35");
|
||||||
|
|
||||||
IPAddress ip2("10.0.244.253");
|
IPAddress ip2("10.0.244.253");
|
||||||
try
|
try
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// NameValueCollectionTest.cpp
|
// NameValueCollectionTest.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/svn/Net/testsuite/src/NameValueCollectionTest.cpp#2 $
|
// $Id: //poco/Main/Net/testsuite/src/NameValueCollectionTest.cpp#7 $
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
@@ -108,7 +108,7 @@ void NameValueCollectionTest::testNameValueCollection()
|
|||||||
std::string v2 = it->second;
|
std::string v2 = it->second;
|
||||||
assert (it->first == "name3");
|
assert (it->first == "name3");
|
||||||
|
|
||||||
assert (v1 == "value3" && v2 == "value31" || v1 == "value31" && v2 == "value3");
|
assert ((v1 == "value3" && v2 == "value31") || (v1 == "value31" && v2 == "value3"));
|
||||||
|
|
||||||
nvc.erase("name3");
|
nvc.erase("name3");
|
||||||
assert (!nvc.has("name3"));
|
assert (!nvc.has("name3"));
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// SocketTest.cpp
|
// SocketTest.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.3/Net/testsuite/src/SocketTest.cpp#2 $
|
// $Id: //poco/Main/Net/testsuite/src/SocketTest.cpp#10 $
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
@@ -282,8 +282,8 @@ void SocketTest::testTimeout()
|
|||||||
void SocketTest::testBufferSize()
|
void SocketTest::testBufferSize()
|
||||||
{
|
{
|
||||||
EchoServer echoServer;
|
EchoServer echoServer;
|
||||||
StreamSocket ss;
|
SocketAddress sa("localhost", 1234);
|
||||||
ss.connect(SocketAddress("localhost", echoServer.port()));
|
StreamSocket ss(sa.family());
|
||||||
|
|
||||||
int osz = ss.getSendBufferSize();
|
int osz = ss.getSendBufferSize();
|
||||||
int rsz = 32000;
|
int rsz = 32000;
|
||||||
@@ -335,15 +335,6 @@ void SocketTest::testOptions()
|
|||||||
|
|
||||||
|
|
||||||
void SocketTest::testSelect()
|
void SocketTest::testSelect()
|
||||||
{
|
|
||||||
doSelectOrPoll1(Socket::select);
|
|
||||||
#if defined(POCO_HAVE_FD_POLL)
|
|
||||||
doSelectOrPoll1(Socket::poll);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SocketTest::doSelectOrPoll1(SelectPtr pAction)
|
|
||||||
{
|
{
|
||||||
Timespan timeout(250000);
|
Timespan timeout(250000);
|
||||||
|
|
||||||
@@ -356,7 +347,7 @@ void SocketTest::doSelectOrPoll1(SelectPtr pAction)
|
|||||||
Socket::SocketList exceptList;
|
Socket::SocketList exceptList;
|
||||||
|
|
||||||
readList.push_back(ss);
|
readList.push_back(ss);
|
||||||
assert (pAction(readList, writeList, exceptList, timeout) == 0);
|
assert (Socket::select(readList, writeList, exceptList, timeout) == 0);
|
||||||
assert (readList.empty());
|
assert (readList.empty());
|
||||||
assert (writeList.empty());
|
assert (writeList.empty());
|
||||||
assert (exceptList.empty());
|
assert (exceptList.empty());
|
||||||
@@ -367,7 +358,7 @@ void SocketTest::doSelectOrPoll1(SelectPtr pAction)
|
|||||||
|
|
||||||
readList.push_back(ss);
|
readList.push_back(ss);
|
||||||
writeList.push_back(ss);
|
writeList.push_back(ss);
|
||||||
assert (pAction(readList, writeList, exceptList, timeout) == 2);
|
assert (Socket::select(readList, writeList, exceptList, timeout) == 2);
|
||||||
assert (!readList.empty());
|
assert (!readList.empty());
|
||||||
assert (!writeList.empty());
|
assert (!writeList.empty());
|
||||||
assert (exceptList.empty());
|
assert (exceptList.empty());
|
||||||
@@ -381,15 +372,6 @@ void SocketTest::doSelectOrPoll1(SelectPtr pAction)
|
|||||||
|
|
||||||
|
|
||||||
void SocketTest::testSelect2()
|
void SocketTest::testSelect2()
|
||||||
{
|
|
||||||
doSelectOrPoll2(Socket::select);
|
|
||||||
#if defined(POCO_HAVE_FD_POLL)
|
|
||||||
doSelectOrPoll2(Socket::poll);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SocketTest::doSelectOrPoll2(SelectPtr pAction)
|
|
||||||
{
|
{
|
||||||
Timespan timeout(100000);
|
Timespan timeout(100000);
|
||||||
|
|
||||||
@@ -404,7 +386,7 @@ void SocketTest::doSelectOrPoll2(SelectPtr pAction)
|
|||||||
|
|
||||||
readList.push_back(ss1);
|
readList.push_back(ss1);
|
||||||
readList.push_back(ss2);
|
readList.push_back(ss2);
|
||||||
assert (pAction(readList, writeList, exceptList, timeout) == 0);
|
assert (Socket::select(readList, writeList, exceptList, timeout) == 0);
|
||||||
assert (readList.empty());
|
assert (readList.empty());
|
||||||
assert (writeList.empty());
|
assert (writeList.empty());
|
||||||
assert (exceptList.empty());
|
assert (exceptList.empty());
|
||||||
@@ -415,7 +397,7 @@ void SocketTest::doSelectOrPoll2(SelectPtr pAction)
|
|||||||
|
|
||||||
readList.push_back(ss1);
|
readList.push_back(ss1);
|
||||||
readList.push_back(ss2);
|
readList.push_back(ss2);
|
||||||
assert (pAction(readList, writeList, exceptList, timeout) == 1);
|
assert (Socket::select(readList, writeList, exceptList, timeout) == 1);
|
||||||
|
|
||||||
assert (readList.size() == 1);
|
assert (readList.size() == 1);
|
||||||
assert (readList[0] == ss1);
|
assert (readList[0] == ss1);
|
||||||
@@ -431,7 +413,7 @@ void SocketTest::doSelectOrPoll2(SelectPtr pAction)
|
|||||||
exceptList.clear();
|
exceptList.clear();
|
||||||
writeList.push_back(ss1);
|
writeList.push_back(ss1);
|
||||||
writeList.push_back(ss2);
|
writeList.push_back(ss2);
|
||||||
assert (pAction(readList, writeList, exceptList, timeout) == 2);
|
assert (Socket::select(readList, writeList, exceptList, timeout) == 2);
|
||||||
assert (readList.empty());
|
assert (readList.empty());
|
||||||
assert (writeList.size() == 2);
|
assert (writeList.size() == 2);
|
||||||
assert (writeList[0] == ss1);
|
assert (writeList[0] == ss1);
|
||||||
@@ -444,22 +426,13 @@ void SocketTest::doSelectOrPoll2(SelectPtr pAction)
|
|||||||
|
|
||||||
|
|
||||||
void SocketTest::testSelect3()
|
void SocketTest::testSelect3()
|
||||||
{
|
|
||||||
doSelectOrPoll3(Socket::select);
|
|
||||||
#if defined(POCO_HAVE_FD_POLL)
|
|
||||||
doSelectOrPoll3(Socket::poll);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SocketTest::doSelectOrPoll3(SelectPtr pAction)
|
|
||||||
{
|
{
|
||||||
Socket::SocketList readList;
|
Socket::SocketList readList;
|
||||||
Socket::SocketList writeList;
|
Socket::SocketList writeList;
|
||||||
Socket::SocketList exceptList;
|
Socket::SocketList exceptList;
|
||||||
Timespan timeout(1000);
|
Timespan timeout(1000);
|
||||||
|
|
||||||
int rc = pAction(readList, writeList, exceptList, timeout);
|
int rc = Socket::select(readList, writeList, exceptList, timeout);
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,5 +465,6 @@ CppUnit::Test* SocketTest::suite()
|
|||||||
CppUnit_addTest(pSuite, SocketTest, testSelect);
|
CppUnit_addTest(pSuite, SocketTest, testSelect);
|
||||||
CppUnit_addTest(pSuite, SocketTest, testSelect2);
|
CppUnit_addTest(pSuite, SocketTest, testSelect2);
|
||||||
CppUnit_addTest(pSuite, SocketTest, testSelect3);
|
CppUnit_addTest(pSuite, SocketTest, testSelect3);
|
||||||
|
|
||||||
return pSuite;
|
return pSuite;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user