assert(channel->poller == this);
channel->poller = NULL;
+ // portability: MSVC throws assertion failure when empty
+ if (channels.empty()) {
+ return;
+ }
+
ChannelList::iterator it = channels.begin();
for (; it != channels.end(); ++it) {
if (*it == channel) {
public:
TestServer()
{
+ Socket::initSockets();
+
open();
bind(NULL, 2000); // localhost, any port
listen(5);
void waitForComplete(HTTP::Client* cl, TestRequest* tr)
{
SGTimeStamp start(SGTimeStamp::now());
- while (start.elapsedMSec() < 1000) {
+ while (start.elapsedMSec() < 10000) {
cl->update();
testServer.poll();
if (tr->complete) {
return;
}
- SGTimeStamp::sleepForMSec(1);
+ SGTimeStamp::sleepForMSec(15);
}
cerr << "timed out" << endl;
void waitForFailed(HTTP::Client* cl, TestRequest* tr)
{
SGTimeStamp start(SGTimeStamp::now());
- while (start.elapsedMSec() < 1000) {
+ while (start.elapsedMSec() < 10000) {
cl->update();
testServer.poll();
if (tr->failed) {
return;
}
- SGTimeStamp::sleepForMSec(1);
+ SGTimeStamp::sleepForMSec(15);
}
cerr << "timed out waiting for failure" << endl;