blob: 38021d43758200fbd745e7f36b8ce9820463d040 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>InspIRCd: socketengine.h Source File</title>
<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4-20050815 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">home</a> » <a class="el" href="dir_000001.html">brain</a> » <a class="el" href="dir_000002.html">inspircd-cvs</a> » <a class="el" href="dir_000003.html">inspircd</a> » <a class="el" href="dir_000004.html">include</a></div>
<h1>socketengine.h</h1><a href="socketengine_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* +------------------------------------+</span>
<a name="l00002"></a>00002 <span class="comment"> * | Inspire Internet Relay Chat Daemon |</span>
<a name="l00003"></a>00003 <span class="comment"> * +------------------------------------+</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Inspire is copyright (C) 2002-2005 ChatSpike-Dev.</span>
<a name="l00006"></a>00006 <span class="comment"> * E-mail:</span>
<a name="l00007"></a>00007 <span class="comment"> * <brain@chatspike.net></span>
<a name="l00008"></a>00008 <span class="comment"> * <Craig@chatspike.net></span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Written by Craig Edwards, Craig McLure, and others.</span>
<a name="l00011"></a>00011 <span class="comment"> * This program is free but copyrighted software; see</span>
<a name="l00012"></a>00012 <span class="comment"> * the file COPYING for details.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * ---------------------------------------------------</span>
<a name="l00015"></a>00015 <span class="comment">*/</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef __SOCKETENGINE__</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __SOCKETENGINE__</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include <vector></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include <string></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "inspircd_config.h"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="globals_8h.html">globals.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="inspircd_8h.html">inspircd.h</a>"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#ifdef USE_EPOLL</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include <sys/epoll.h></span>
<a name="l00027"></a>00027 <span class="preprocessor">#define EP_DELAY 5</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#ifdef USE_KQUEUE</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#include <sys/types.h></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include <sys/event.h></span>
<a name="l00032"></a>00032 <span class="preprocessor">#include <sys/time.h></span>
<a name="l00033"></a>00033 <span class="preprocessor">#endif</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00041"></a><a class="code" href="socketengine_8h.html#X_5FEMPTY_5FSLOT">00041</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="socketengine_8h.html#X_5FEMPTY_5FSLOT">X_EMPTY_SLOT</a> = 0;
<a name="l00042"></a><a class="code" href="socketengine_8h.html#X_5FLISTEN">00042</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="socketengine_8h.html#X_5FLISTEN">X_LISTEN</a> = 1;
<a name="l00043"></a><a class="code" href="socketengine_8h.html#X_5FESTAB_5FCLIENT">00043</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="socketengine_8h.html#X_5FESTAB_5FCLIENT">X_ESTAB_CLIENT</a> = 2;
<a name="l00044"></a><a class="code" href="socketengine_8h.html#X_5FESTAB_5FMODULE">00044</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="socketengine_8h.html#X_5FESTAB_5FMODULE">X_ESTAB_MODULE</a> = 3;
<a name="l00045"></a><a class="code" href="socketengine_8h.html#X_5FESTAB_5FDNS">00045</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="socketengine_8h.html#X_5FESTAB_5FDNS">X_ESTAB_DNS</a> = 4;
<a name="l00046"></a>00046
<a name="l00055"></a><a class="code" href="socketengine_8h.html#X_5FREADBIT">00055</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="socketengine_8h.html#X_5FREADBIT">X_READBIT</a> = 0x80;
<a name="l00056"></a>00056
<a name="l00066"></a><a class="code" href="classSocketEngine.html">00066</a> <span class="keyword">class </span><a class="code" href="classSocketEngine.html">SocketEngine</a> {
<a name="l00067"></a>00067
<a name="l00068"></a><a class="code" href="classSocketEngine.html#fds">00068</a> std::vector<int> <a class="code" href="classSocketEngine.html#fds">fds</a>; <span class="comment">/* List of file descriptors being monitored */</span>
<a name="l00069"></a><a class="code" href="classSocketEngine.html#EngineHandle">00069</a> <span class="keywordtype">int</span> <a class="code" href="classSocketEngine.html#EngineHandle">EngineHandle</a>; <span class="comment">/* Handle to the socket engine if needed */</span>
<a name="l00070"></a>00070 <span class="preprocessor">#ifdef USE_SELECT</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span> fd_set wfdset, rfdset; <span class="comment">/* Readable and writeable sets for select() */</span>
<a name="l00072"></a>00072 <span class="preprocessor">#endif</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#ifdef USE_KQUEUE</span>
<a name="l00074"></a><a class="code" href="classSocketEngine.html#ke_5Flist_5B_36_35_35_33_35_5D">00074</a> <span class="preprocessor"></span> <span class="keyword">struct </span>kevent ke_list[65535]; <span class="comment">/* Up to 64k sockets for kqueue */</span>
<a name="l00075"></a><a class="code" href="classSocketEngine.html#ts">00075</a> <span class="keyword">struct </span>timespec ts; <span class="comment">/* kqueue delay value */</span>
<a name="l00076"></a>00076 <span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#ifdef USE_EPOLL</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span> <span class="keyword">struct </span>epoll_event events[65535]; <span class="comment">/* Up to 64k sockets for epoll */</span>
<a name="l00079"></a>00079 <span class="preprocessor">#endif</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span>
<a name="l00081"></a>00081 <span class="keyword">public</span>:
<a name="l00082"></a>00082
<a name="l00091"></a>00091 <a class="code" href="classSocketEngine.html#SocketEngine_28_29">SocketEngine</a>();
<a name="l00092"></a>00092
<a name="l00097"></a>00097 <a class="code" href="classSocketEngine.html#_7ESocketEngine_28_29">~SocketEngine</a>();
<a name="l00098"></a>00098
<a name="l00108"></a>00108 <span class="keywordtype">bool</span> <a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">bool</span> readable, <span class="keywordtype">char</span> type);
<a name="l00109"></a>00109
<a name="l00120"></a>00120 <span class="keywordtype">char</span> <a class="code" href="classSocketEngine.html#GetType_28int_20fd_29">GetType</a>(<span class="keywordtype">int</span> fd);
<a name="l00121"></a>00121
<a name="l00127"></a>00127 <span class="keywordtype">bool</span> <a class="code" href="classSocketEngine.html#DelFd_28int_20fd_29">DelFd</a>(<span class="keywordtype">int</span> fd);
<a name="l00128"></a>00128
<a name="l00135"></a>00135 <span class="keywordtype">bool</span> <a class="code" href="classSocketEngine.html#Wait_28std_3A_3Avector_3C_20int_20_3E_20_26fdlist_29">Wait</a>(std::vector<int> &fdlist);
<a name="l00136"></a>00136
<a name="l00141"></a>00141 <a class="code" href="namespaceirc.html#string">std::string</a> <a class="code" href="classSocketEngine.html#GetName_28_29">GetName</a>();
<a name="l00142"></a>00142 };
<a name="l00143"></a>00143
<a name="l00144"></a>00144 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Dec 19 18:05:20 2005 for InspIRCd by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
</body>
</html>
|