summaryrefslogtreecommitdiff
path: root/include/socketengine.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 09:53:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 09:53:10 +0000
commit58f0da0eb938fb26b6c90b049e682ec26e9b7824 (patch)
tree5a11c70468f294334f7a112bffa4a5fa8e3db41c /include/socketengine.h
parentef7e7d0ede476ca4d57485891704a2d99bd03c88 (diff)
Added preliminary socketengine stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2321 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socketengine.h')
-rw-r--r--include/socketengine.h51
1 files changed, 50 insertions, 1 deletions
diff --git a/include/socketengine.h b/include/socketengine.h
index 9a4610f5f..967c0967b 100644
--- a/include/socketengine.h
+++ b/include/socketengine.h
@@ -12,7 +12,54 @@
* the file COPYING for details.
*
* ---------------------------------------------------
- */
+*/
+
+#ifndef __SOCKETENGINE__
+#define __SOCKETENGINE__
+
+#include <vector>
+#include <string>
+
+class SocketEngine {
+
+ std::vector<int> fds;
+ int EngineHandle;
+#ifdef USE_SELECT
+ fd_set wfdset, rfdset;
+#endif
+#ifdef USE_KQUEUE
+ struct kevent ke_list[65535];
+ struct timespec ts;
+#endif
+#ifdef USE_EPOLL
+ struct epoll_event events[65535];
+#endif
+
+public:
+
+ SocketEngine();
+ ~SocketEngine();
+ bool AddFd(int fd, bool readable, bool writeable, char type);
+ bool DelFd(int fd);
+ bool Wait(unsigned long millisecs, std::vector<int> &fdlist);
+ std::string GetName();
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
// Fill the engine with client file descriptors pending an action
@@ -320,3 +367,5 @@
#define engine_name "epoll"
#endif
+
+#endif