summaryrefslogtreecommitdiff
path: root/src/SocketCore.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-01-15 15:23:16 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-01-15 15:23:16 +0000
commit1ab8ade5d1a6cbebcd574c48cfd9150058c5dc75 (patch)
tree96e57d1de14db540ab92d51d0c3884ba5da54a07 /src/SocketCore.h
parent5fbd9977842150c05a4e53ddcecb602f11a1d673 (diff)
2009-01-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --event-poll option to select the method for polling events. The available methods are "select" and "epoll". "epoll" is available on Linux only. The earlier release has the compile option to choose from these methods. * configure.ac * src/RequestGroupMan.cc * src/OptionHandlerFactory.cc * src/EpollEventPoll.h * src/StreamFileAllocationEntry.cc * src/a2io.h * src/SelectEventPoll.h * src/option_processing.cc * src/prefs.h * src/EpollEventPoll.cc * src/EventPoll.h * src/SocketCore.h * src/Makefile.am * src/main.cc * src/DownloadEngine.h * src/SelectEventPoll.cc * src/DownloadEngine.cc * src/SocketCore.cc * src/DownloadEngineFactory.cc * src/Makefile.in * src/prefs.cc * src/usage_text.h
Diffstat (limited to 'src/SocketCore.h')
-rw-r--r--src/SocketCore.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/SocketCore.h b/src/SocketCore.h
index c385170b..11578616 100644
--- a/src/SocketCore.h
+++ b/src/SocketCore.h
@@ -37,9 +37,9 @@
#include "common.h"
-#ifdef HAVE_EPOLL_CREATE
+#ifdef HAVE_EPOLL
# include <sys/epoll.h>
-#endif // HAVE_EPOLL_CREATE
+#endif // HAVE_EPOLL
#include <string>
#include <cstdlib>
@@ -82,8 +82,15 @@ private:
struct epoll_event _epEvent;
+ enum PollMethod {
+ POLL_METHOD_EPOLL, POLL_METHOD_SELECT
+ };
+
+ static PollMethod _pollMethod;
+
#endif // HAVE_EPOLL
+
bool blocking;
int secure;
@@ -327,6 +334,11 @@ public:
*/
bool wantWrite() const;
+#ifdef HAVE_EPOLL
+ static void useEpoll();
+#endif // HAVE_EPOLL
+ static void useSelect();
+
#ifdef ENABLE_SSL
static void setTLSContext(const SharedHandle<TLSContext>& tlsContext);
#endif // ENABLE_SSL