From 563519092736c3cbfc82c5bf5662f91c9718dcf4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 24 Apr 2010 14:08:10 +0000 Subject: 2010-04-24 Tatsuhiro Tsujikawa In SocketCore::isReadable()/isWritable(), use poll() if it is available otherwise use select(). Removed epoll/port from there because poll() does the good enough job for single socket event notification. * src/SocketCore.cc * src/SocketCore.h * src/main.cc --- src/SocketCore.h | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'src/SocketCore.h') diff --git a/src/SocketCore.h b/src/SocketCore.h index dd5fe2e7..723d55de 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -37,10 +37,6 @@ #include "common.h" -#ifdef HAVE_EPOLL -# include -#endif // HAVE_EPOLL - #include #include #include @@ -78,28 +74,6 @@ private: // socket endpoint descriptor sock_t sockfd; -#ifdef HAVE_EPOLL - - // file descriptor used for epoll - int _epfd; - - struct epoll_event _epEvent; - -#endif // HAVE_EPOLL - -#ifdef HAVE_PORT_ASSOCIATE - int _portfd; -#endif // HAVE_PORT_ASSOCIATE - - enum PollMethod { - POLL_METHOD_EPOLL, - POLL_METHOD_PORT, - POLL_METHOD_POLL, - POLL_METHOD_SELECT - }; - - static PollMethod _pollMethod; - static int _protocolFamily; static std::vector > _bindAddrs; @@ -138,13 +112,6 @@ private: void bind(const struct sockaddr* addr, socklen_t addrlen); -#ifdef HAVE_EPOLL - void initEPOLL(); -#endif // HAVE_EPOLL -#ifdef HAVE_PORT_ASSOCIATE - void initPort(); -#endif // HAVE_PORT_ASSOCIATE - void setSockOpt(int level, int optname, void* optval, socklen_t optlen); SocketCore(sock_t sockfd, int sockType); @@ -365,17 +332,6 @@ public: */ bool wantWrite() const; -#ifdef HAVE_EPOLL - static void useEpoll(); -#endif // HAVE_EPOLL -#ifdef HAVE_PORT_ASSOCIATE - static void usePort(); -#endif // HAVE_PORT_ASSOCIATE -#ifdef HAVE_POLL - static void usePoll(); -#endif // HAVE_POLL - static void useSelect(); - #ifdef ENABLE_SSL static void setTLSContext(const SharedHandle& tlsContext); #endif // ENABLE_SSL -- cgit