};
-static FDMultiplexer* make()
+static FDMultiplexer* makeEpoll()
{
return new EpollFDMultiplexer();
}
-static struct RegisterOurselves
+static struct EpollRegisterOurselves
{
- RegisterOurselves() {
- FDMultiplexer::getMultiplexerMap().insert(make_pair(0, &make)); // priority 0!
+ EpollRegisterOurselves() {
+ FDMultiplexer::getMultiplexerMap().insert(make_pair(0, &makeEpoll)); // priority 0!
}
-} doIt;
+} doItEpoll;
int EpollFDMultiplexer::s_maxevents=1024;
return new KqueueFDMultiplexer();
}
-static struct RegisterOurselves
+static struct KqueueRegisterOurselves
{
- RegisterOurselves() {
+ KqueueRegisterOurselves() {
FDMultiplexer::getMultiplexerMap().insert(make_pair(0, &make)); // priority 0!
}
-} doIt;
+} kQueuedoIt;
KqueueFDMultiplexer::KqueueFDMultiplexer() : d_kevents(new struct kevent[s_maxevents])
{
setSendBuffer(fd, 65000);
listen(fd, 128);
g_fdm->addReadFD(fd, handleNewTCPQuestion);
- L<<Logger::Error<<"Listening for TCP queries on "<< sockAddrToString(&sin.sin4) <<":"<<::arg().asNum("local-port")<<endl;
+ if(sin.sin4.sin_family == AF_INET)
+ L<<Logger::Error<<"Listening for TCP queries on "<< sin.toString() <<":"<<::arg().asNum("local-port")<<endl;
+ else
+ L<<Logger::Error<<"Listening for TCP queries on ["<< sin.toString() <<"]:"<<::arg().asNum("local-port")<<endl;
}
}
Utility::setNonBlocking(fd);
g_fdm->addReadFD(fd, handleNewUDPQuestion);
g_tcpListenSockets.push_back(fd);
- L<<Logger::Error<<"Listening for UDP queries on "<<sin.toString()<<":"<<::arg().asNum("local-port")<<endl;
+ if(sin.sin4.sin_family == AF_INET)
+ L<<Logger::Error<<"Listening for UDP queries on "<< sin.toString() <<":"<<::arg().asNum("local-port")<<endl;
+ else
+ L<<Logger::Error<<"Listening for UDP queries on ["<< sin.toString() <<"]:"<<::arg().asNum("local-port")<<endl;
}
}