diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-30 18:31:05 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-30 18:31:05 +0000 |
commit | 7aa5e059a8f66d91bd8b69c58c657ceb70b4baff (patch) | |
tree | 3c846a54d4391ff662d0339fd7854a1c215ba7e5 /src/socketengines/socketengine_select.cpp | |
parent | 4a64082e31c3c3dfa97a1edfb8a3c97fe8d32ea7 (diff) |
Remove include/inspircd_se_config.h and socketengine-specific headers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11784 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengines/socketengine_select.cpp')
-rw-r--r-- | src/socketengines/socketengine_select.cpp | 52 |
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; +} |