summaryrefslogtreecommitdiff
path: root/src/socketengines/socketengine_select.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengines/socketengine_select.cpp')
-rw-r--r--src/socketengines/socketengine_select.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp
index b35558a70..f0668aafb 100644
--- a/src/socketengines/socketengine_select.cpp
+++ b/src/socketengines/socketengine_select.cpp
@@ -15,7 +15,52 @@
#ifndef WINDOWS
#include <sys/select.h>
#endif // WINDOWS
-#include "socketengines/socketengine_select.h"
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __SOCKETENGINE_SELECT__
+#define __SOCKETENGINE_SELECT__
+
+#include <vector>
+#include <string>
+#include <map>
+#ifndef WINDOWS
+#include <sys/select.h>
+#endif // WINDOWS
+#include "inspircd_config.h"
+#include "inspircd.h"
+#include "socketengine.h"
+
+/** A specialisation of the SocketEngine class, designed to use traditional select().
+ */
+class SelectEngine : public SocketEngine
+{
+public:
+ /** Create a new SelectEngine
+ */
+ SelectEngine();
+ /** Delete a SelectEngine
+ */
+ virtual ~SelectEngine();
+ virtual bool AddFd(EventHandler* eh, int event_mask);
+ virtual bool DelFd(EventHandler* eh, bool force = false);
+ void OnSetEvent(EventHandler* eh, int, int);
+ virtual int DispatchEvents();
+ virtual std::string GetName();
+};
+
+#endif
+
SelectEngine::SelectEngine()
@@ -148,3 +193,8 @@ std::string SelectEngine::GetName()
{
return "select";
}
+
+SocketEngine* CreateSocketEngine()
+{
+ return new SelectEngine;
+}