From 097b2479d0393d8a8bada4a50708d7a2404045ca Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Dec 2005 13:32:15 +0000 Subject: Added new docs for class SocketEngine git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2339 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/socketengine_8h-source.html | 89 +++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 docs/module-doc/socketengine_8h-source.html (limited to 'docs/module-doc/socketengine_8h-source.html') diff --git a/docs/module-doc/socketengine_8h-source.html b/docs/module-doc/socketengine_8h-source.html new file mode 100644 index 000000000..12481b1fe --- /dev/null +++ b/docs/module-doc/socketengine_8h-source.html @@ -0,0 +1,89 @@ + +
+00001 /* +------------------------------------+ +00002 * | Inspire Internet Relay Chat Daemon | +00003 * +------------------------------------+ +00004 * +00005 * Inspire is copyright (C) 2002-2005 ChatSpike-Dev. +00006 * E-mail: +00007 * <brain@chatspike.net> +00008 * <Craig@chatspike.net> +00009 * +00010 * Written by Craig Edwards, Craig McLure, and others. +00011 * This program is free but copyrighted software; see +00012 * the file COPYING for details. +00013 * +00014 * --------------------------------------------------- +00015 */ +00016 +00017 #ifndef __SOCKETENGINE__ +00018 #define __SOCKETENGINE__ +00019 +00020 #include <vector> +00021 #include <string> +00022 #include "inspircd_config.h" +00023 #include "globals.h" +00024 #include "inspircd.h" +00025 #ifdef USE_EPOLL +00026 #include <sys/epoll.h> +00027 #define EP_DELAY 5 +00028 #endif +00029 #ifdef USE_KQUEUE +00030 #include <sys/types.h> +00031 #include <sys/event.h> +00032 #include <sys/time.h> +00033 #endif +00034 +00041 const char X_EMPTY_SLOT = 0; +00042 const char X_LISTEN = 1; +00043 const char X_ESTAB_CLIENT = 2; +00044 const char X_ESTAB_MODULE = 3; +00045 const char X_ESTAB_DNS = 4; +00046 +00055 const char X_READBIT = 0x80; +00056 +00066 class SocketEngine { +00067 +00068 std::vector<int> fds; /* List of file descriptors being monitored */ +00069 int EngineHandle; /* Handle to the socket engine if needed */ +00070 #ifdef USE_SELECT +00071 fd_set wfdset, rfdset; /* Readable and writeable sets for select() */ +00072 #endif +00073 #ifdef USE_KQUEUE +00074 struct kevent ke_list[65535]; /* Up to 64k sockets for kqueue */ +00075 struct timespec ts; /* kqueue delay value */ +00076 #endif +00077 #ifdef USE_EPOLL +00078 struct epoll_event events[65535]; /* Up to 64k sockets for epoll */ +00079 #endif +00080 +00081 public: +00082 +00091 SocketEngine(); +00092 +00097 ~SocketEngine(); +00098 +00108 bool AddFd(int fd, bool readable, char type); +00109 +00120 char GetType(int fd); +00121 +00127 bool DelFd(int fd); +00128 +00135 bool Wait(std::vector<int> &fdlist); +00136 +00141 std::string GetName(); +00142 }; +00143 +00144 #endif +
1.4.4-20050815
+
+
--
cgit v1.3.1-10-gc9f91