summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/socketengine_epoll.h15
-rw-r--r--include/socketengine_kqueue.h19
-rw-r--r--include/socketengine_select.h19
-rw-r--r--include/xline.h2
4 files changed, 50 insertions, 5 deletions
diff --git a/include/socketengine_epoll.h b/include/socketengine_epoll.h
index 65d1150f7..f675671e2 100644
--- a/include/socketengine_epoll.h
+++ b/include/socketengine_epoll.h
@@ -29,12 +29,21 @@
class InspIRCd;
+/** A specialisation of the SocketEngine class, designed to use linux 2.6 epoll().
+ */
class EPollEngine : public SocketEngine
{
private:
- struct epoll_event events[MAX_DESCRIPTORS]; /* Up to 64k sockets for epoll */
+ /** These are used by epoll() to hold socket events
+ */
+ struct epoll_event events[MAX_DESCRIPTORS];
public:
+ /** Create a new EPollEngine
+ * @param Instance The creator of this object
+ */
EPollEngine(InspIRCd* Instance);
+ /** Delete an EPollEngine
+ */
virtual ~EPollEngine();
virtual bool AddFd(int fd, bool readable, char type);
virtual int GetMaxFds();
@@ -44,9 +53,13 @@ public:
virtual std::string GetName();
};
+/** Creates a SocketEngine
+ */
class SocketEngineFactory
{
public:
+ /** Create a new instance of SocketEngine based on EpollEngine
+ */
SocketEngine* Create(InspIRCd* Instance) { return new EPollEngine(Instance); }
};
diff --git a/include/socketengine_kqueue.h b/include/socketengine_kqueue.h
index d7451b642..2010949ed 100644
--- a/include/socketengine_kqueue.h
+++ b/include/socketengine_kqueue.h
@@ -30,13 +30,24 @@
class InspIRCd;
+/** A specialisation of the SocketEngine class, designed to use FreeBSD kqueue().
+ */
class KQueueEngine : public SocketEngine
{
private:
- struct kevent ke_list[MAX_DESCRIPTORS]; /* Up to 64k sockets for kqueue */
- struct timespec ts; /* kqueue delay value */
+ /** These are used by kqueue() to hold socket events
+ */
+ struct kevent ke_list[MAX_DESCRIPTORS];
+ /** This is a specialised time value used by kqueue()
+ */
+ struct timespec ts;
public:
+ /** Create a new KQueueEngine
+ * @param Instance The creator of this object
+ */
KQueueEngine(InspIRCd* Instance);
+ /** Delete a KQueueEngine
+ */
virtual ~KQueueEngine();
virtual bool AddFd(int fd, bool readable, char type);
virtual int GetMaxFds();
@@ -46,9 +57,13 @@ public:
virtual std::string GetName();
};
+/** Creates a SocketEngine
+ */
class SocketEngineFactory
{
public:
+ /** Create a new instance of SocketEngine based on KQueueEngine
+ */
SocketEngine* Create(InspIRCd* Instance) { return new KQueueEngine(InspIRCd* Instance); }
};
diff --git a/include/socketengine_select.h b/include/socketengine_select.h
index b3f7479ee..a6db96ee5 100644
--- a/include/socketengine_select.h
+++ b/include/socketengine_select.h
@@ -28,13 +28,24 @@
class InspIRCd;
+/** A specialisation of the SocketEngine class, designed to use traditional select().
+ */
class SelectEngine : public SocketEngine
{
private:
- std::map<int,int> fds; /* List of file descriptors being monitored */
- fd_set wfdset, rfdset; /* Readable and writeable sets for select() */
+ /** Because select() does not track an fd list for us between calls, we have one of our own
+ */
+ std::map<int,int> fds;
+ /** The read set and write set, populated before each call to select().
+ */
+ fd_set wfdset, rfdset;
public:
+ /** Create a new SelectEngine
+ * @param Instance The creator of this object
+ */
SelectEngine(InspIRCd* Instance);
+ /** Delete a SelectEngine
+ */
virtual ~SelectEngine();
virtual bool AddFd(int fd, bool readable, char type);
virtual int GetMaxFds();
@@ -44,9 +55,13 @@ public:
virtual std::string GetName();
};
+/** Creates a SocketEngine
+ */
class SocketEngineFactory
{
public:
+ /** Create a new instance of SocketEngine based on SelectEngine
+ */
SocketEngine* Create(InspIRCd* Instance) { return new SelectEngine(InspIRCd* Instance); }
};
diff --git a/include/xline.h b/include/xline.h
index ad76fe8e5..9c42a32e5 100644
--- a/include/xline.h
+++ b/include/xline.h
@@ -84,6 +84,8 @@ class GLine : public XLine
char hostmask[200];
};
+/** ELine class
+ */
class ELine : public XLine
{
public: