]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classInspSocket.html
Added new docs for class InspIRCd and globals.h etc
[user/henk/code/inspircd.git] / docs / module-doc / classInspSocket.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: InspSocket Class Reference</title>
4 <link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.4.4-20050815 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <h1>InspSocket Class Reference</h1><!-- doxytag: class="InspSocket" -->InspSocket is an extendable socket class which modules can use for TCP socket support.  
9 <a href="#_details">More...</a>
10 <p>
11 <code>#include &lt;<a class="el" href="socket_8h-source.html">socket.h</a>&gt;</code>
12 <p>
13 Collaboration diagram for InspSocket:<p><center><img src="classInspSocket__coll__graph.gif" border="0" usemap="#InspSocket__coll__map" alt="Collaboration graph"></center>
14 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classInspSocket-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
15 <tr><td></td></tr>
16 <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
17 <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#InspSocket_28_29">InspSocket</a> ()</td></tr>
18
19 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The default constructor does nothing and should not be used.  <a href="#InspSocket_28_29"></a><br></td></tr>
20 <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#InspSocket_28int_20newfd_2C_20char_20_2Aip_29">InspSocket</a> (int newfd, char *ip)</td></tr>
21
22 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor is used to associate an existing connecting with an InspSocket class.  <a href="#InspSocket_28int_20newfd_2C_20char_20_2Aip_29"></a><br></td></tr>
23 <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#InspSocket_28std_3A_3Astring_20host_2C_20int_20port_2C_20bool_20listening_2C_20unsigned_20long_20maxtime_29">InspSocket</a> (<a class="el" href="namespaceirc.html#string">std::string</a> <a class="el" href="classInspSocket.html#host">host</a>, int <a class="el" href="classInspSocket.html#port">port</a>, bool listening, unsigned long maxtime)</td></tr>
24
25 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor is used to create a new socket, either listening for connections, or an outbound connection to another host.  <a href="#InspSocket_28std_3A_3Astring_20host_2C_20int_20port_2C_20bool_20listening_2C_20unsigned_20long_20maxtime_29"></a><br></td></tr>
26 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnConnected_28_29">OnConnected</a> ()</td></tr>
27
28 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is called when an outbound connection on your socket is completed.  <a href="#OnConnected_28_29"></a><br></td></tr>
29 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError</a> (<a class="el" href="socket_8h.html#InspSocketError">InspSocketError</a> e)</td></tr>
30
31 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is called when an error occurs.  <a href="#OnError_28InspSocketError_20e_29"></a><br></td></tr>
32 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnDisconnect_28_29">OnDisconnect</a> ()</td></tr>
33
34 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">When an established connection is terminated, the OnDisconnect method is triggered.  <a href="#OnDisconnect_28_29"></a><br></td></tr>
35 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnDataReady_28_29">OnDataReady</a> ()</td></tr>
36
37 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">When there is data waiting to be read on a socket, the <a class="el" href="classInspSocket.html#OnDataReady_28_29">OnDataReady()</a> method is called.  <a href="#OnDataReady_28_29"></a><br></td></tr>
38 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnTimeout_28_29">OnTimeout</a> ()</td></tr>
39
40 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">When an outbound connection fails, and the attempt times out, you will receive this event.  <a href="#OnTimeout_28_29"></a><br></td></tr>
41 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnClose_28_29">OnClose</a> ()</td></tr>
42
43 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Whenever close() is called, <a class="el" href="classInspSocket.html#OnClose_28_29">OnClose()</a> will be called first.  <a href="#OnClose_28_29"></a><br></td></tr>
44 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#Read_28_29">Read</a> ()</td></tr>
45
46 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads all pending bytes from the socket into a char* array which can be up to 16 kilobytes in length.  <a href="#Read_28_29"></a><br></td></tr>
47 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#GetIP_28_29">GetIP</a> ()</td></tr>
48
49 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the IP address associated with this connection, or an empty string if no IP address exists.  <a href="#GetIP_28_29"></a><br></td></tr>
50 <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#Timeout_28time_5Ft_20current_29">Timeout</a> (time_t current)</td></tr>
51
52 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This function checks if the socket has timed out yet, given the current time in the parameter.  <a href="#Timeout_28time_5Ft_20current_29"></a><br></td></tr>
53 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#Write_28std_3A_3Astring_20data_29">Write</a> (<a class="el" href="namespaceirc.html#string">std::string</a> data)</td></tr>
54
55 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes a <a class="el" href="namespaceirc.html#string">std::string</a> to the socket.  <a href="#Write_28std_3A_3Astring_20data_29"></a><br></td></tr>
56 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#OnIncomingConnection_28int_20newfd_2C_20char_20_2Aip_29">OnIncomingConnection</a> (int newfd, char *ip)</td></tr>
57
58 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If your socket is a listening socket, when a new connection comes in on the socket this method will be called.  <a href="#OnIncomingConnection_28int_20newfd_2C_20char_20_2Aip_29"></a><br></td></tr>
59 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#SetState_28InspSocketState_20s_29">SetState</a> (<a class="el" href="socket_8h.html#InspSocketState">InspSocketState</a> s)</td></tr>
60
61 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Changes the socket's state.  <a href="#SetState_28InspSocketState_20s_29"></a><br></td></tr>
62 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="socket_8h.html#InspSocketState">InspSocketState</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#GetState_28_29">GetState</a> ()</td></tr>
63
64 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the current socket state.  <a href="#GetState_28_29"></a><br></td></tr>
65 <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#Poll_28_29">Poll</a> ()</td></tr>
66
67 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Only the core should call this function.  <a href="#Poll_28_29"></a><br></td></tr>
68 <tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#GetFd_28_29">GetFd</a> ()</td></tr>
69
70 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method returns the socket's file descriptor as assigned by the operating system, or -1 if no descriptor has been assigned.  <a href="#GetFd_28_29"></a><br></td></tr>
71 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#Close_28_29">Close</a> ()</td></tr>
72
73 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method causes the socket to close, and may also be triggered by other methods such as OnTimeout and OnError.  <a href="#Close_28_29"></a><br></td></tr>
74 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#_7EInspSocket_28_29">~InspSocket</a> ()</td></tr>
75
76 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor may implicitly call <a class="el" href="classInspSocket.html#OnClose_28_29">OnClose()</a>, and will close() and shutdown() the file descriptor used for this socket.  <a href="#_7EInspSocket_28_29"></a><br></td></tr>
77 <tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
78 <tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#fd">fd</a></td></tr>
79
80 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The file descriptor of this socket.  <a href="#fd"></a><br></td></tr>
81 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#host">host</a></td></tr>
82
83 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The hostname connected to.  <a href="#host"></a><br></td></tr>
84 <tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#port">port</a></td></tr>
85
86 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The port connected to, or the port this socket is listening on.  <a href="#port"></a><br></td></tr>
87 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="socket_8h.html#InspSocketState">InspSocketState</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#state">state</a></td></tr>
88
89 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The state for this socket, either listening, connecting, connected or error.  <a href="#state"></a><br></td></tr>
90 <tr><td class="memItemLeft" nowrap align="right" valign="top">sockaddr_in&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#addr">addr</a></td></tr>
91
92 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The host being connected to, in sockaddr form.  <a href="#addr"></a><br></td></tr>
93 <tr><td class="memItemLeft" nowrap align="right" valign="top">in_addr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#addy">addy</a></td></tr>
94
95 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The host being connected to, in in_addr form.  <a href="#addy"></a><br></td></tr>
96 <tr><td class="memItemLeft" nowrap align="right" valign="top">time_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#timeout_5Fend">timeout_end</a></td></tr>
97
98 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">When this time is reached, the socket times out if it is in the CONNECTING state.  <a href="#timeout_5Fend"></a><br></td></tr>
99 <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#timeout">timeout</a></td></tr>
100
101 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This value is true if the socket has timed out.  <a href="#timeout"></a><br></td></tr>
102 <tr><td class="memItemLeft" nowrap align="right" valign="top">char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#ibuf_5B_31_36_33_38_34_5D">ibuf</a> [16384]</td></tr>
103
104 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Socket input buffer, used by read().  <a href="#ibuf_5B_31_36_33_38_34_5D"></a><br></td></tr>
105 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#IP">IP</a></td></tr>
106
107 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The IP address being connected to stored in string form for easy retrieval by accessors.  <a href="#IP"></a><br></td></tr>
108 <tr><td class="memItemLeft" nowrap align="right" valign="top">sockaddr_in&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#client">client</a></td></tr>
109
110 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Client sockaddr structure used by accept().  <a href="#client"></a><br></td></tr>
111 <tr><td class="memItemLeft" nowrap align="right" valign="top">sockaddr_in&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#server">server</a></td></tr>
112
113 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classServer.html">Server</a> sockaddr structure used by accept().  <a href="#server"></a><br></td></tr>
114 <tr><td class="memItemLeft" nowrap align="right" valign="top">socklen_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInspSocket.html#length">length</a></td></tr>
115
116 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used by accept() to indicate the sizes of the sockaddr_in structures.  <a href="#length"></a><br></td></tr>
117 </table>
118 <hr><a name="_details"></a><h2>Detailed Description</h2>
119 InspSocket is an extendable socket class which modules can use for TCP socket support. 
120 <p>
121 It is fully integrated into InspIRCds socket loop and attaches its sockets to the core's instance of the <a class="el" href="classSocketEngine.html">SocketEngine</a> class, meaning that any sockets you create have the same power and abilities as a socket created by the core itself. To use InspSocket, you must inherit a class from it, and use the InspSocket constructors to establish connections and bindings.
122 <p>
123
124 <p>
125 Definition at line <a class="el" href="socket_8h-source.html#l00047">47</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
126 <a class="anchor" name="InspSocket_28_29"></a><!-- doxytag: member="InspSocket::InspSocket" ref="InspSocket_28_29" args="()" --><p>
127 <table class="mdTable" cellpadding="2" cellspacing="0">
128   <tr>
129     <td class="mdRow">
130       <table cellpadding="0" cellspacing="0" border="0">
131         <tr>
132           <td class="md" nowrap valign="top">InspSocket::InspSocket           </td>
133           <td class="md" valign="top">(&nbsp;</td>
134           <td class="mdname1" valign="top" nowrap>          </td>
135           <td class="md" valign="top">&nbsp;)&nbsp;</td>
136           <td class="md" nowrap></td>
137         </tr>
138       </table>
139     </td>
140   </tr>
141 </table>
142 <table cellspacing="5" cellpadding="0" border="0">
143   <tr>
144     <td>
145       &nbsp;
146     </td>
147     <td>
148
149 <p>
150 The default constructor does nothing and should not be used. 
151 <p>
152
153 <p>
154 Definition at line <a class="el" href="socket_8cpp-source.html#l00048">48</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
155 <p>
156 References <a class="el" href="socket_8h.html#InspSocketStateI_5FDISCONNECTED">I_DISCONNECTED</a>, and <a class="el" href="socket_8h-source.html#l00072">state</a>.<div class="fragment"><pre class="fragment"><a name="l00049"></a>00049 {
157 <a name="l00050"></a>00050         this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FDISCONNECTED">I_DISCONNECTED</a>;
158 <a name="l00051"></a>00051 }
159 </pre></div>
160 <p>
161     </td>
162   </tr>
163 </table>
164 <a class="anchor" name="InspSocket_28int_20newfd_2C_20char_20_2Aip_29"></a><!-- doxytag: member="InspSocket::InspSocket" ref="InspSocket_28int_20newfd_2C_20char_20_2Aip_29" args="(int newfd, char *ip)" --><p>
165 <table class="mdTable" cellpadding="2" cellspacing="0">
166   <tr>
167     <td class="mdRow">
168       <table cellpadding="0" cellspacing="0" border="0">
169         <tr>
170           <td class="md" nowrap valign="top">InspSocket::InspSocket           </td>
171           <td class="md" valign="top">(&nbsp;</td>
172           <td class="md" nowrap valign="top">int&nbsp;</td>
173           <td class="mdname" nowrap> <em>newfd</em>, </td>
174         </tr>
175         <tr>
176           <td class="md" nowrap align="right"></td>
177           <td class="md"></td>
178           <td class="md" nowrap>char *&nbsp;</td>
179           <td class="mdname" nowrap> <em>ip</em></td>
180         </tr>
181         <tr>
182           <td class="md"></td>
183           <td class="md">)&nbsp;</td>
184           <td class="md" colspan="2"></td>
185         </tr>
186       </table>
187     </td>
188   </tr>
189 </table>
190 <table cellspacing="5" cellpadding="0" border="0">
191   <tr>
192     <td>
193       &nbsp;
194     </td>
195     <td>
196
197 <p>
198 This constructor is used to associate an existing connecting with an InspSocket class. 
199 <p>
200 The given file descriptor must be valid, and when initialized, the InspSocket will be set with the given IP address and placed in CONNECTED state.
201 <p>
202 Definition at line <a class="el" href="socket_8cpp-source.html#l00053">53</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
203 <p>
204 References <a class="el" href="socketengine_8cpp-source.html#l00065">SocketEngine::AddFd()</a>, <a class="el" href="socket_8h-source.html#l00054">fd</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FCONNECTED">I_CONNECTED</a>, <a class="el" href="socket_8h-source.html#l00113">IP</a>, <a class="el" href="socket_8h-source.html#l00072">state</a>, and <a class="el" href="socketengine_8h-source.html#l00044">X_ESTAB_MODULE</a>.<div class="fragment"><pre class="fragment"><a name="l00054"></a>00054 {
205 <a name="l00055"></a>00055         this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a> = newfd;
206 <a name="l00056"></a>00056         this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FCONNECTED">I_CONNECTED</a>;
207 <a name="l00057"></a>00057         this-&gt;<a class="code" href="classInspSocket.html#IP">IP</a> = ip;
208 <a name="l00058"></a>00058         <a class="code" href="modules_8cpp.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(this-&gt;fd,<span class="keyword">true</span>,<a class="code" href="socketengine_8h.html#X_5FESTAB_5FMODULE">X_ESTAB_MODULE</a>);
209 <a name="l00059"></a>00059         <a class="code" href="socket_8cpp.html#socket_5Fref_5B_36_35_35_33_35_5D">socket_ref</a>[this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a>] = <span class="keyword">this</span>;
210 <a name="l00060"></a>00060 }
211 </pre></div>
212 <p>
213     </td>
214   </tr>
215 </table>
216 <a class="anchor" name="InspSocket_28std_3A_3Astring_20host_2C_20int_20port_2C_20bool_20listening_2C_20unsigned_20long_20maxtime_29"></a><!-- doxytag: member="InspSocket::InspSocket" ref="InspSocket_28std_3A_3Astring_20host_2C_20int_20port_2C_20bool_20listening_2C_20unsigned_20long_20maxtime_29" args="(std::string host, int port, bool listening, unsigned long maxtime)" --><p>
217 <table class="mdTable" cellpadding="2" cellspacing="0">
218   <tr>
219     <td class="mdRow">
220       <table cellpadding="0" cellspacing="0" border="0">
221         <tr>
222           <td class="md" nowrap valign="top">InspSocket::InspSocket           </td>
223           <td class="md" valign="top">(&nbsp;</td>
224           <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td>
225           <td class="mdname" nowrap> <em>host</em>, </td>
226         </tr>
227         <tr>
228           <td class="md" nowrap align="right"></td>
229           <td class="md"></td>
230           <td class="md" nowrap>int&nbsp;</td>
231           <td class="mdname" nowrap> <em>port</em>, </td>
232         </tr>
233         <tr>
234           <td class="md" nowrap align="right"></td>
235           <td class="md"></td>
236           <td class="md" nowrap>bool&nbsp;</td>
237           <td class="mdname" nowrap> <em>listening</em>, </td>
238         </tr>
239         <tr>
240           <td class="md" nowrap align="right"></td>
241           <td class="md"></td>
242           <td class="md" nowrap>unsigned long&nbsp;</td>
243           <td class="mdname" nowrap> <em>maxtime</em></td>
244         </tr>
245         <tr>
246           <td class="md"></td>
247           <td class="md">)&nbsp;</td>
248           <td class="md" colspan="2"></td>
249         </tr>
250       </table>
251     </td>
252   </tr>
253 </table>
254 <table cellspacing="5" cellpadding="0" border="0">
255   <tr>
256     <td>
257       &nbsp;
258     </td>
259     <td>
260
261 <p>
262 This constructor is used to create a new socket, either listening for connections, or an outbound connection to another host. 
263 <p>
264 <dl compact><dt><b>Parameters:</b></dt><dd>
265   <table border="0" cellspacing="2" cellpadding="0">
266     <tr><td valign="top"></td><td valign="top"><em>host</em>&nbsp;</td><td>The hostname to connect to, or bind to </td></tr>
267     <tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>The port number to connect to, or bind to </td></tr>
268     <tr><td valign="top"></td><td valign="top"><em>listening</em>&nbsp;</td><td>true to listen on the given host:port pair, or false to connect to them </td></tr>
269     <tr><td valign="top"></td><td valign="top"><em>maxtime</em>&nbsp;</td><td>Number of seconds to wait, if connecting, before the connection times out and an <a class="el" href="classInspSocket.html#OnTimeout_28_29">OnTimeout()</a> event is generated</td></tr>
270   </table>
271 </dl>
272
273 <p>
274 Definition at line <a class="el" href="socket_8cpp-source.html#l00062">62</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
275 <p>
276 References <a class="el" href="socketengine_8cpp-source.html#l00065">SocketEngine::AddFd()</a>, <a class="el" href="socket_8h-source.html#l00078">addr</a>, <a class="el" href="socket_8h-source.html#l00084">addy</a>, <a class="el" href="inspircd__io_8h.html#BindSocket_28int_20sockfd_2C_20struct_20sockaddr_5Fin_20client_2C_20struct_20sockaddr_5Fin_20server_2C_20int_20port_2C_20char_20_2Aaddr_29">BindSocket()</a>, <a class="el" href="socket_8cpp-source.html#l00141">Close()</a>, <a class="el" href="inspircd__io_8h-source.html#l00028">DEBUG</a>, <a class="el" href="inspircd_8h-source.html#l00049">ERROR</a>, <a class="el" href="socket_8h-source.html#l00054">fd</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FCONNECTING">I_CONNECTING</a>, <a class="el" href="socket_8h.html#InspSocketErrorI_5FERR_5FBIND">I_ERR_BIND</a>, <a class="el" href="socket_8h.html#InspSocketErrorI_5FERR_5FCONNECT">I_ERR_CONNECT</a>, <a class="el" href="socket_8h.html#InspSocketErrorI_5FERR_5FSOCKET">I_ERR_SOCKET</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FLISTENING">I_LISTENING</a>, <a class="el" href="socket_8h-source.html#l00113">IP</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="socket_8cpp-source.html#l00265">OnError()</a>, <a class="el" href="inspircd__io_8h.html#OpenTCPSocket_28void_29">OpenTCPSocket()</a>, <a class="el" href="socket_8h-source.html#l00072">state</a>, <a class="el" href="socket_8h-source.html#l00097">timeout</a>, <a class="el" href="socket_8h-source.html#l00091">timeout_end</a>, and <a class="el" href="socketengine_8h-source.html#l00044">X_ESTAB_MODULE</a>.<div class="fragment"><pre class="fragment"><a name="l00063"></a>00063 {
277 <a name="l00064"></a>00064         <span class="keywordflow">if</span> (listening) {
278 <a name="l00065"></a>00065                 <span class="keywordflow">if</span> ((this-&gt;fd = <a class="code" href="inspircd__io_8h.html#OpenTCPSocket_28void_29">OpenTCPSocket</a>()) == <a class="code" href="inspircd_8h.html#ERROR">ERROR</a>)
279 <a name="l00066"></a>00066                 {
280 <a name="l00067"></a>00067                         this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a> = -1;
281 <a name="l00068"></a>00068                         this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>;
282 <a name="l00069"></a>00069                         this-&gt;<a class="code" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError</a>(<a class="code" href="socket_8h.html#InspSocketErrorI_5FERR_5FSOCKET">I_ERR_SOCKET</a>);
283 <a name="l00070"></a>00070                         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"OpenTCPSocket() error"</span>);
284 <a name="l00071"></a>00071                         <span class="keywordflow">return</span>;
285 <a name="l00072"></a>00072                 }
286 <a name="l00073"></a>00073                 <span class="keywordflow">else</span>
287 <a name="l00074"></a>00074                 {
288 <a name="l00075"></a>00075                         <span class="keywordflow">if</span> (<a class="code" href="inspircd__io_8h.html#BindSocket_28int_20sockfd_2C_20struct_20sockaddr_5Fin_20client_2C_20struct_20sockaddr_5Fin_20server_2C_20int_20port_2C_20char_20_2Aaddr_29">BindSocket</a>(this-&gt;fd,this-&gt;client,this-&gt;server,<a class="code" href="classInspSocket.html#port">port</a>,(<span class="keywordtype">char</span>*)<a class="code" href="classInspSocket.html#host">host</a>.c_str()) == <a class="code" href="inspircd_8h.html#ERROR">ERROR</a>)
289 <a name="l00076"></a>00076                         {
290 <a name="l00077"></a>00077                                 this-&gt;<a class="code" href="classInspSocket.html#Close_28_29">Close</a>();
291 <a name="l00078"></a>00078                                 this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a> = -1;
292 <a name="l00079"></a>00079                                 this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>;
293 <a name="l00080"></a>00080                                 this-&gt;<a class="code" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError</a>(<a class="code" href="socket_8h.html#InspSocketErrorI_5FERR_5FBIND">I_ERR_BIND</a>);
294 <a name="l00081"></a>00081                                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"BindSocket() error %s"</span>,strerror(errno));
295 <a name="l00082"></a>00082                                 <span class="keywordflow">return</span>;
296 <a name="l00083"></a>00083                         }
297 <a name="l00084"></a>00084                         <span class="keywordflow">else</span>
298 <a name="l00085"></a>00085                         {
299 <a name="l00086"></a>00086                                 this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FLISTENING">I_LISTENING</a>;
300 <a name="l00087"></a>00087                                 <a class="code" href="modules_8cpp.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(this-&gt;fd,<span class="keyword">true</span>,<a class="code" href="socketengine_8h.html#X_5FESTAB_5FMODULE">X_ESTAB_MODULE</a>);
301 <a name="l00088"></a>00088                                 <a class="code" href="socket_8cpp.html#socket_5Fref_5B_36_35_35_33_35_5D">socket_ref</a>[this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a>] = <span class="keyword">this</span>;
302 <a name="l00089"></a>00089                                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"New socket now in I_LISTENING state"</span>);
303 <a name="l00090"></a>00090                                 <span class="keywordflow">return</span>;
304 <a name="l00091"></a>00091                         }
305 <a name="l00092"></a>00092                 }                       
306 <a name="l00093"></a>00093         } <span class="keywordflow">else</span> {
307 <a name="l00094"></a>00094                 <span class="keywordtype">char</span>* ip;
308 <a name="l00095"></a>00095                 this-&gt;<a class="code" href="classInspSocket.html#host">host</a> = <a class="code" href="classInspSocket.html#host">host</a>;
309 <a name="l00096"></a>00096                 hostent* hoste = gethostbyname(<a class="code" href="classInspSocket.html#host">host</a>.c_str());
310 <a name="l00097"></a>00097                 <span class="keywordflow">if</span> (!hoste) {
311 <a name="l00098"></a>00098                         ip = (<span class="keywordtype">char</span>*)<a class="code" href="classInspSocket.html#host">host</a>.c_str();
312 <a name="l00099"></a>00099                 } <span class="keywordflow">else</span> {
313 <a name="l00100"></a>00100                         <span class="keyword">struct </span>in_addr* ia = (in_addr*)hoste-&gt;h_addr;
314 <a name="l00101"></a>00101                         ip = inet_ntoa(*ia);
315 <a name="l00102"></a>00102                 }
316 <a name="l00103"></a>00103 
317 <a name="l00104"></a>00104                 this-&gt;<a class="code" href="classInspSocket.html#IP">IP</a> = ip;
318 <a name="l00105"></a>00105 
319 <a name="l00106"></a>00106                 <a class="code" href="classInspSocket.html#timeout_5Fend">timeout_end</a> = time(NULL)+maxtime;
320 <a name="l00107"></a>00107                 <a class="code" href="classInspSocket.html#timeout">timeout</a> = <span class="keyword">false</span>;
321 <a name="l00108"></a>00108                 <span class="keywordflow">if</span> ((this-&gt;fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
322 <a name="l00109"></a>00109                 {
323 <a name="l00110"></a>00110                         this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>;
324 <a name="l00111"></a>00111                         this-&gt;<a class="code" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError</a>(<a class="code" href="socket_8h.html#InspSocketErrorI_5FERR_5FSOCKET">I_ERR_SOCKET</a>);
325 <a name="l00112"></a>00112                         <span class="keywordflow">return</span>;
326 <a name="l00113"></a>00113                 }
327 <a name="l00114"></a>00114                 this-&gt;<a class="code" href="classInspSocket.html#port">port</a> = <a class="code" href="classInspSocket.html#port">port</a>;
328 <a name="l00115"></a>00115                 inet_aton(ip,&amp;<a class="code" href="classInspSocket.html#addy">addy</a>);
329 <a name="l00116"></a>00116                 <a class="code" href="classInspSocket.html#addr">addr</a>.sin_family = AF_INET;
330 <a name="l00117"></a>00117                 <a class="code" href="classInspSocket.html#addr">addr</a>.sin_addr = <a class="code" href="classInspSocket.html#addy">addy</a>;
331 <a name="l00118"></a>00118                 <a class="code" href="classInspSocket.html#addr">addr</a>.sin_port = htons(this-&gt;port);
332 <a name="l00119"></a>00119 
333 <a name="l00120"></a>00120                 <span class="keywordtype">int</span> flags;
334 <a name="l00121"></a>00121                 flags = fcntl(this-&gt;fd, F_GETFL, 0);
335 <a name="l00122"></a>00122                 fcntl(this-&gt;fd, F_SETFL, flags | O_NONBLOCK);
336 <a name="l00123"></a>00123 
337 <a name="l00124"></a>00124                 <span class="keywordflow">if</span>(connect(this-&gt;fd, (sockaddr*)&amp;this-&gt;addr,<span class="keyword">sizeof</span>(this-&gt;addr)) == -1)
338 <a name="l00125"></a>00125                 {
339 <a name="l00126"></a>00126                         <span class="keywordflow">if</span> (errno != EINPROGRESS)
340 <a name="l00127"></a>00127                         {
341 <a name="l00128"></a>00128                                 this-&gt;<a class="code" href="classInspSocket.html#Close_28_29">Close</a>();
342 <a name="l00129"></a>00129                                 this-&gt;<a class="code" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError</a>(<a class="code" href="socket_8h.html#InspSocketErrorI_5FERR_5FCONNECT">I_ERR_CONNECT</a>);
343 <a name="l00130"></a>00130                                 this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>;
344 <a name="l00131"></a>00131                                 <span class="keywordflow">return</span>;
345 <a name="l00132"></a>00132                         }
346 <a name="l00133"></a>00133                 }
347 <a name="l00134"></a>00134                 this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FCONNECTING">I_CONNECTING</a>;
348 <a name="l00135"></a>00135                 <a class="code" href="modules_8cpp.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(this-&gt;fd,<span class="keyword">false</span>,<a class="code" href="socketengine_8h.html#X_5FESTAB_5FMODULE">X_ESTAB_MODULE</a>);
349 <a name="l00136"></a>00136                 <a class="code" href="socket_8cpp.html#socket_5Fref_5B_36_35_35_33_35_5D">socket_ref</a>[this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a>] = <span class="keyword">this</span>;
350 <a name="l00137"></a>00137                 <span class="keywordflow">return</span>;
351 <a name="l00138"></a>00138         }
352 <a name="l00139"></a>00139 }
353 </pre></div>
354 <p>
355     </td>
356   </tr>
357 </table>
358 <a class="anchor" name="_7EInspSocket_28_29"></a><!-- doxytag: member="InspSocket::~InspSocket" ref="_7EInspSocket_28_29" args="()" --><p>
359 <table class="mdTable" cellpadding="2" cellspacing="0">
360   <tr>
361     <td class="mdRow">
362       <table cellpadding="0" cellspacing="0" border="0">
363         <tr>
364           <td class="md" nowrap valign="top">InspSocket::~InspSocket           </td>
365           <td class="md" valign="top">(&nbsp;</td>
366           <td class="mdname1" valign="top" nowrap>          </td>
367           <td class="md" valign="top">&nbsp;)&nbsp;</td>
368           <td class="md" nowrap><code> [virtual]</code></td>
369         </tr>
370       </table>
371     </td>
372   </tr>
373 </table>
374 <table cellspacing="5" cellpadding="0" border="0">
375   <tr>
376     <td>
377       &nbsp;
378     </td>
379     <td>
380
381 <p>
382 The destructor may implicitly call <a class="el" href="classInspSocket.html#OnClose_28_29">OnClose()</a>, and will close() and shutdown() the file descriptor used for this socket. 
383 <p>
384
385 <p>
386 Definition at line <a class="el" href="socket_8cpp-source.html#l00272">272</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
387 <p>
388 References <a class="el" href="socket_8cpp-source.html#l00141">Close()</a>.<div class="fragment"><pre class="fragment"><a name="l00273"></a>00273 {
389 <a name="l00274"></a>00274         this-&gt;<a class="code" href="classInspSocket.html#Close_28_29">Close</a>();
390 <a name="l00275"></a>00275 }
391 </pre></div>
392 <p>
393     </td>
394   </tr>
395 </table>
396 <hr><h2>Member Function Documentation</h2>
397 <a class="anchor" name="Close_28_29"></a><!-- doxytag: member="InspSocket::Close" ref="Close_28_29" args="()" --><p>
398 <table class="mdTable" cellpadding="2" cellspacing="0">
399   <tr>
400     <td class="mdRow">
401       <table cellpadding="0" cellspacing="0" border="0">
402         <tr>
403           <td class="md" nowrap valign="top">void InspSocket::Close           </td>
404           <td class="md" valign="top">(&nbsp;</td>
405           <td class="mdname1" valign="top" nowrap>          </td>
406           <td class="md" valign="top">&nbsp;)&nbsp;</td>
407           <td class="md" nowrap><code> [virtual]</code></td>
408         </tr>
409       </table>
410     </td>
411   </tr>
412 </table>
413 <table cellspacing="5" cellpadding="0" border="0">
414   <tr>
415     <td>
416       &nbsp;
417     </td>
418     <td>
419
420 <p>
421 This method causes the socket to close, and may also be triggered by other methods such as OnTimeout and OnError. 
422 <p>
423
424 <p>
425 Definition at line <a class="el" href="socket_8cpp-source.html#l00141">141</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
426 <p>
427 References <a class="el" href="socket_8h-source.html#l00054">fd</a>, and <a class="el" href="socket_8cpp-source.html#l00270">OnClose()</a>.
428 <p>
429 Referenced by <a class="el" href="socket_8cpp-source.html#l00062">InspSocket()</a>, and <a class="el" href="socket_8cpp-source.html#l00272">~InspSocket()</a>.<div class="fragment"><pre class="fragment"><a name="l00142"></a>00142 {
430 <a name="l00143"></a>00143         <span class="keywordflow">if</span> (this-&gt;fd != -1)
431 <a name="l00144"></a>00144         {
432 <a name="l00145"></a>00145                 this-&gt;<a class="code" href="classInspSocket.html#OnClose_28_29">OnClose</a>();
433 <a name="l00146"></a>00146                 shutdown(this-&gt;fd,2);
434 <a name="l00147"></a>00147                 close(this-&gt;fd);
435 <a name="l00148"></a>00148                 <a class="code" href="socket_8cpp.html#socket_5Fref_5B_36_35_35_33_35_5D">socket_ref</a>[this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a>] = NULL;
436 <a name="l00149"></a>00149                 this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a> = -1;
437 <a name="l00150"></a>00150         }
438 <a name="l00151"></a>00151 }
439 </pre></div>
440 <p>
441     </td>
442   </tr>
443 </table>
444 <a class="anchor" name="GetFd_28_29"></a><!-- doxytag: member="InspSocket::GetFd" ref="GetFd_28_29" args="()" --><p>
445 <table class="mdTable" cellpadding="2" cellspacing="0">
446   <tr>
447     <td class="mdRow">
448       <table cellpadding="0" cellspacing="0" border="0">
449         <tr>
450           <td class="md" nowrap valign="top">int InspSocket::GetFd           </td>
451           <td class="md" valign="top">(&nbsp;</td>
452           <td class="mdname1" valign="top" nowrap>          </td>
453           <td class="md" valign="top">&nbsp;)&nbsp;</td>
454           <td class="md" nowrap></td>
455         </tr>
456       </table>
457     </td>
458   </tr>
459 </table>
460 <table cellspacing="5" cellpadding="0" border="0">
461   <tr>
462     <td>
463       &nbsp;
464     </td>
465     <td>
466
467 <p>
468 This method returns the socket's file descriptor as assigned by the operating system, or -1 if no descriptor has been assigned. 
469 <p>
470
471 <p>
472 Definition at line <a class="el" href="socket_8cpp-source.html#l00259">259</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
473 <p>
474 References <a class="el" href="socket_8h-source.html#l00054">fd</a>.<div class="fragment"><pre class="fragment"><a name="l00260"></a>00260 {
475 <a name="l00261"></a>00261         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classInspSocket.html#fd">fd</a>;
476 <a name="l00262"></a>00262 }
477 </pre></div>
478 <p>
479     </td>
480   </tr>
481 </table>
482 <a class="anchor" name="GetIP_28_29"></a><!-- doxytag: member="InspSocket::GetIP" ref="GetIP_28_29" args="()" --><p>
483 <table class="mdTable" cellpadding="2" cellspacing="0">
484   <tr>
485     <td class="mdRow">
486       <table cellpadding="0" cellspacing="0" border="0">
487         <tr>
488           <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> InspSocket::GetIP           </td>
489           <td class="md" valign="top">(&nbsp;</td>
490           <td class="mdname1" valign="top" nowrap>          </td>
491           <td class="md" valign="top">&nbsp;)&nbsp;</td>
492           <td class="md" nowrap></td>
493         </tr>
494       </table>
495     </td>
496   </tr>
497 </table>
498 <table cellspacing="5" cellpadding="0" border="0">
499   <tr>
500     <td>
501       &nbsp;
502     </td>
503     <td>
504
505 <p>
506 Returns the IP address associated with this connection, or an empty string if no IP address exists. 
507 <p>
508
509 <p>
510 Definition at line <a class="el" href="socket_8cpp-source.html#l00153">153</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
511 <p>
512 References <a class="el" href="socket_8h-source.html#l00113">IP</a>.<div class="fragment"><pre class="fragment"><a name="l00154"></a>00154 {
513 <a name="l00155"></a>00155         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classInspSocket.html#IP">IP</a>;
514 <a name="l00156"></a>00156 }
515 </pre></div>
516 <p>
517     </td>
518   </tr>
519 </table>
520 <a class="anchor" name="GetState_28_29"></a><!-- doxytag: member="InspSocket::GetState" ref="GetState_28_29" args="()" --><p>
521 <table class="mdTable" cellpadding="2" cellspacing="0">
522   <tr>
523     <td class="mdRow">
524       <table cellpadding="0" cellspacing="0" border="0">
525         <tr>
526           <td class="md" nowrap valign="top"><a class="el" href="socket_8h.html#InspSocketState">InspSocketState</a> InspSocket::GetState           </td>
527           <td class="md" valign="top">(&nbsp;</td>
528           <td class="mdname1" valign="top" nowrap>          </td>
529           <td class="md" valign="top">&nbsp;)&nbsp;</td>
530           <td class="md" nowrap></td>
531         </tr>
532       </table>
533     </td>
534   </tr>
535 </table>
536 <table cellspacing="5" cellpadding="0" border="0">
537   <tr>
538     <td>
539       &nbsp;
540     </td>
541     <td>
542
543 <p>
544 Returns the current socket state. 
545 <p>
546
547 <p>
548 Definition at line <a class="el" href="socket_8cpp-source.html#l00254">254</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
549 <p>
550 References <a class="el" href="socket_8h-source.html#l00072">state</a>.<div class="fragment"><pre class="fragment"><a name="l00255"></a>00255 {
551 <a name="l00256"></a>00256         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classInspSocket.html#state">state</a>;
552 <a name="l00257"></a>00257 }
553 </pre></div>
554 <p>
555     </td>
556   </tr>
557 </table>
558 <a class="anchor" name="OnClose_28_29"></a><!-- doxytag: member="InspSocket::OnClose" ref="OnClose_28_29" args="()" --><p>
559 <table class="mdTable" cellpadding="2" cellspacing="0">
560   <tr>
561     <td class="mdRow">
562       <table cellpadding="0" cellspacing="0" border="0">
563         <tr>
564           <td class="md" nowrap valign="top">void InspSocket::OnClose           </td>
565           <td class="md" valign="top">(&nbsp;</td>
566           <td class="mdname1" valign="top" nowrap>          </td>
567           <td class="md" valign="top">&nbsp;)&nbsp;</td>
568           <td class="md" nowrap><code> [virtual]</code></td>
569         </tr>
570       </table>
571     </td>
572   </tr>
573 </table>
574 <table cellspacing="5" cellpadding="0" border="0">
575   <tr>
576     <td>
577       &nbsp;
578     </td>
579     <td>
580
581 <p>
582 Whenever close() is called, <a class="el" href="classInspSocket.html#OnClose_28_29">OnClose()</a> will be called first. 
583 <p>
584 Please note that this means OnClose will be called alongside <a class="el" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError()</a>, <a class="el" href="classInspSocket.html#OnTimeout_28_29">OnTimeout()</a>, and <a class="el" href="classInspSocket.html#Close_28_29">Close()</a>, and also when cancelling a listening socket by calling the destructor indirectly.
585 <p>
586 Definition at line <a class="el" href="socket_8cpp-source.html#l00270">270</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
587 <p>
588 Referenced by <a class="el" href="socket_8cpp-source.html#l00141">Close()</a>.<div class="fragment"><pre class="fragment"><a name="l00270"></a>00270 { <span class="keywordflow">return</span>; }
589 </pre></div>
590 <p>
591     </td>
592   </tr>
593 </table>
594 <a class="anchor" name="OnConnected_28_29"></a><!-- doxytag: member="InspSocket::OnConnected" ref="OnConnected_28_29" args="()" --><p>
595 <table class="mdTable" cellpadding="2" cellspacing="0">
596   <tr>
597     <td class="mdRow">
598       <table cellpadding="0" cellspacing="0" border="0">
599         <tr>
600           <td class="md" nowrap valign="top">bool InspSocket::OnConnected           </td>
601           <td class="md" valign="top">(&nbsp;</td>
602           <td class="mdname1" valign="top" nowrap>          </td>
603           <td class="md" valign="top">&nbsp;)&nbsp;</td>
604           <td class="md" nowrap><code> [virtual]</code></td>
605         </tr>
606       </table>
607     </td>
608   </tr>
609 </table>
610 <table cellspacing="5" cellpadding="0" border="0">
611   <tr>
612     <td>
613       &nbsp;
614     </td>
615     <td>
616
617 <p>
618 This method is called when an outbound connection on your socket is completed. 
619 <p>
620 <dl compact><dt><b>Returns:</b></dt><dd>false to abort the connection, true to continue</dd></dl>
621
622 <p>
623 Definition at line <a class="el" href="socket_8cpp-source.html#l00264">264</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
624 <p>
625 Referenced by <a class="el" href="socket_8cpp-source.html#l00217">Poll()</a>.<div class="fragment"><pre class="fragment"><a name="l00264"></a>00264 { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
626 </pre></div>
627 <p>
628     </td>
629   </tr>
630 </table>
631 <a class="anchor" name="OnDataReady_28_29"></a><!-- doxytag: member="InspSocket::OnDataReady" ref="OnDataReady_28_29" args="()" --><p>
632 <table class="mdTable" cellpadding="2" cellspacing="0">
633   <tr>
634     <td class="mdRow">
635       <table cellpadding="0" cellspacing="0" border="0">
636         <tr>
637           <td class="md" nowrap valign="top">bool InspSocket::OnDataReady           </td>
638           <td class="md" valign="top">(&nbsp;</td>
639           <td class="mdname1" valign="top" nowrap>          </td>
640           <td class="md" valign="top">&nbsp;)&nbsp;</td>
641           <td class="md" nowrap><code> [virtual]</code></td>
642         </tr>
643       </table>
644     </td>
645   </tr>
646 </table>
647 <table cellspacing="5" cellpadding="0" border="0">
648   <tr>
649     <td>
650       &nbsp;
651     </td>
652     <td>
653
654 <p>
655 When there is data waiting to be read on a socket, the <a class="el" href="classInspSocket.html#OnDataReady_28_29">OnDataReady()</a> method is called. 
656 <p>
657 Within this method, you *MUST* call the <a class="el" href="classInspSocket.html#Read_28_29">Read()</a> method to read any pending data. At its lowest level, this event is signalled by the core via the socket engine. If you return false from this function, the core removes your socket from its list and erases it from the socket engine, then calls <a class="el" href="classInspSocket.html#Close_28_29">InspSocket::Close()</a> and deletes it. <dl compact><dt><b>Returns:</b></dt><dd>false to close the socket</dd></dl>
658
659 <p>
660 Definition at line <a class="el" href="socket_8cpp-source.html#l00268">268</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
661 <p>
662 Referenced by <a class="el" href="socket_8cpp-source.html#l00217">Poll()</a>.<div class="fragment"><pre class="fragment"><a name="l00268"></a>00268 { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
663 </pre></div>
664 <p>
665     </td>
666   </tr>
667 </table>
668 <a class="anchor" name="OnDisconnect_28_29"></a><!-- doxytag: member="InspSocket::OnDisconnect" ref="OnDisconnect_28_29" args="()" --><p>
669 <table class="mdTable" cellpadding="2" cellspacing="0">
670   <tr>
671     <td class="mdRow">
672       <table cellpadding="0" cellspacing="0" border="0">
673         <tr>
674           <td class="md" nowrap valign="top">int InspSocket::OnDisconnect           </td>
675           <td class="md" valign="top">(&nbsp;</td>
676           <td class="mdname1" valign="top" nowrap>          </td>
677           <td class="md" valign="top">&nbsp;)&nbsp;</td>
678           <td class="md" nowrap><code> [virtual]</code></td>
679         </tr>
680       </table>
681     </td>
682   </tr>
683 </table>
684 <table cellspacing="5" cellpadding="0" border="0">
685   <tr>
686     <td>
687       &nbsp;
688     </td>
689     <td>
690
691 <p>
692 When an established connection is terminated, the OnDisconnect method is triggered. 
693 <p>
694
695 <p>
696 Definition at line <a class="el" href="socket_8cpp-source.html#l00266">266</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00266"></a>00266 { <span class="keywordflow">return</span> 0; }
697 </pre></div>
698 <p>
699     </td>
700   </tr>
701 </table>
702 <a class="anchor" name="OnError_28InspSocketError_20e_29"></a><!-- doxytag: member="InspSocket::OnError" ref="OnError_28InspSocketError_20e_29" args="(InspSocketError e)" --><p>
703 <table class="mdTable" cellpadding="2" cellspacing="0">
704   <tr>
705     <td class="mdRow">
706       <table cellpadding="0" cellspacing="0" border="0">
707         <tr>
708           <td class="md" nowrap valign="top">void InspSocket::OnError           </td>
709           <td class="md" valign="top">(&nbsp;</td>
710           <td class="md" nowrap valign="top"><a class="el" href="socket_8h.html#InspSocketError">InspSocketError</a>&nbsp;</td>
711           <td class="mdname1" valign="top" nowrap> <em>e</em>          </td>
712           <td class="md" valign="top">&nbsp;)&nbsp;</td>
713           <td class="md" nowrap><code> [virtual]</code></td>
714         </tr>
715       </table>
716     </td>
717   </tr>
718 </table>
719 <table cellspacing="5" cellpadding="0" border="0">
720   <tr>
721     <td>
722       &nbsp;
723     </td>
724     <td>
725
726 <p>
727 This method is called when an error occurs. 
728 <p>
729 A closed socket in itself is not an error, however errors also generate close events. <dl compact><dt><b>Parameters:</b></dt><dd>
730   <table border="0" cellspacing="2" cellpadding="0">
731     <tr><td valign="top"></td><td valign="top"><em>e</em>&nbsp;</td><td>The error type which occured</td></tr>
732   </table>
733 </dl>
734
735 <p>
736 Definition at line <a class="el" href="socket_8cpp-source.html#l00265">265</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
737 <p>
738 Referenced by <a class="el" href="socket_8cpp-source.html#l00062">InspSocket()</a>, and <a class="el" href="socket_8cpp-source.html#l00200">Timeout()</a>.<div class="fragment"><pre class="fragment"><a name="l00265"></a>00265 { <span class="keywordflow">return</span>; }
739 </pre></div>
740 <p>
741     </td>
742   </tr>
743 </table>
744 <a class="anchor" name="OnIncomingConnection_28int_20newfd_2C_20char_20_2Aip_29"></a><!-- doxytag: member="InspSocket::OnIncomingConnection" ref="OnIncomingConnection_28int_20newfd_2C_20char_20_2Aip_29" args="(int newfd, char *ip)" --><p>
745 <table class="mdTable" cellpadding="2" cellspacing="0">
746   <tr>
747     <td class="mdRow">
748       <table cellpadding="0" cellspacing="0" border="0">
749         <tr>
750           <td class="md" nowrap valign="top">int InspSocket::OnIncomingConnection           </td>
751           <td class="md" valign="top">(&nbsp;</td>
752           <td class="md" nowrap valign="top">int&nbsp;</td>
753           <td class="mdname" nowrap> <em>newfd</em>, </td>
754         </tr>
755         <tr>
756           <td class="md" nowrap align="right"></td>
757           <td class="md"></td>
758           <td class="md" nowrap>char *&nbsp;</td>
759           <td class="mdname" nowrap> <em>ip</em></td>
760         </tr>
761         <tr>
762           <td class="md"></td>
763           <td class="md">)&nbsp;</td>
764           <td class="md" colspan="2"><code> [virtual]</code></td>
765         </tr>
766       </table>
767     </td>
768   </tr>
769 </table>
770 <table cellspacing="5" cellpadding="0" border="0">
771   <tr>
772     <td>
773       &nbsp;
774     </td>
775     <td>
776
777 <p>
778 If your socket is a listening socket, when a new connection comes in on the socket this method will be called. 
779 <p>
780 Given the new file descriptor in the parameters, and the IP, it is recommended you copy them to a new instance of your socket class, e.g.:<p>
781 MySocket* newsocket = new MySocket(newfd,ip);<p>
782 Once you have done this, you can then associate the new socket with the core using <a class="el" href="classServer.html#AddSocket_28InspSocket_20_2Asock_29">Server::AddSocket()</a>.
783 <p>
784 Definition at line <a class="el" href="socket_8cpp-source.html#l00267">267</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
785 <p>
786 Referenced by <a class="el" href="socket_8cpp-source.html#l00217">Poll()</a>.<div class="fragment"><pre class="fragment"><a name="l00267"></a>00267 { <span class="keywordflow">return</span> 0; }
787 </pre></div>
788 <p>
789     </td>
790   </tr>
791 </table>
792 <a class="anchor" name="OnTimeout_28_29"></a><!-- doxytag: member="InspSocket::OnTimeout" ref="OnTimeout_28_29" args="()" --><p>
793 <table class="mdTable" cellpadding="2" cellspacing="0">
794   <tr>
795     <td class="mdRow">
796       <table cellpadding="0" cellspacing="0" border="0">
797         <tr>
798           <td class="md" nowrap valign="top">void InspSocket::OnTimeout           </td>
799           <td class="md" valign="top">(&nbsp;</td>
800           <td class="mdname1" valign="top" nowrap>          </td>
801           <td class="md" valign="top">&nbsp;)&nbsp;</td>
802           <td class="md" nowrap><code> [virtual]</code></td>
803         </tr>
804       </table>
805     </td>
806   </tr>
807 </table>
808 <table cellspacing="5" cellpadding="0" border="0">
809   <tr>
810     <td>
811       &nbsp;
812     </td>
813     <td>
814
815 <p>
816 When an outbound connection fails, and the attempt times out, you will receive this event. 
817 <p>
818 The mthod will trigger once maxtime secons are reached (as given in the constructor) just before the socket's descriptor is closed.
819 <p>
820 Definition at line <a class="el" href="socket_8cpp-source.html#l00269">269</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
821 <p>
822 Referenced by <a class="el" href="socket_8cpp-source.html#l00200">Timeout()</a>.<div class="fragment"><pre class="fragment"><a name="l00269"></a>00269 { <span class="keywordflow">return</span>; }
823 </pre></div>
824 <p>
825     </td>
826   </tr>
827 </table>
828 <a class="anchor" name="Poll_28_29"></a><!-- doxytag: member="InspSocket::Poll" ref="Poll_28_29" args="()" --><p>
829 <table class="mdTable" cellpadding="2" cellspacing="0">
830   <tr>
831     <td class="mdRow">
832       <table cellpadding="0" cellspacing="0" border="0">
833         <tr>
834           <td class="md" nowrap valign="top">bool InspSocket::Poll           </td>
835           <td class="md" valign="top">(&nbsp;</td>
836           <td class="mdname1" valign="top" nowrap>          </td>
837           <td class="md" valign="top">&nbsp;)&nbsp;</td>
838           <td class="md" nowrap></td>
839         </tr>
840       </table>
841     </td>
842   </tr>
843 </table>
844 <table cellspacing="5" cellpadding="0" border="0">
845   <tr>
846     <td>
847       &nbsp;
848     </td>
849     <td>
850
851 <p>
852 Only the core should call this function. 
853 <p>
854 When called, it is assumed the socket is ready to read data, and the method call routes the event to the various methods of InspSocket for you to handle. This can also cause the socket's state to change.
855 <p>
856 Definition at line <a class="el" href="socket_8cpp-source.html#l00217">217</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
857 <p>
858 References <a class="el" href="socketengine_8cpp-source.html#l00065">SocketEngine::AddFd()</a>, <a class="el" href="socket_8h-source.html#l00119">client</a>, <a class="el" href="socketengine_8cpp-source.html#l00103">SocketEngine::DelFd()</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FCONNECTED">I_CONNECTED</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FCONNECTING">I_CONNECTING</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FLISTENING">I_LISTENING</a>, <a class="el" href="socket_8h-source.html#l00131">length</a>, <a class="el" href="socket_8cpp-source.html#l00264">OnConnected()</a>, <a class="el" href="socket_8cpp-source.html#l00268">OnDataReady()</a>, <a class="el" href="socket_8cpp-source.html#l00267">OnIncomingConnection()</a>, <a class="el" href="socket_8cpp-source.html#l00248">SetState()</a>, and <a class="el" href="socketengine_8h-source.html#l00044">X_ESTAB_MODULE</a>.<div class="fragment"><pre class="fragment"><a name="l00218"></a>00218 {
859 <a name="l00219"></a>00219         <span class="keywordtype">int</span> incoming = -1;
860 <a name="l00220"></a>00220         
861 <a name="l00221"></a>00221         <span class="keywordflow">switch</span> (this-&gt;state)
862 <a name="l00222"></a>00222         {
863 <a name="l00223"></a>00223                 <span class="keywordflow">case</span> <a class="code" href="socket_8h.html#InspSocketStateI_5FCONNECTING">I_CONNECTING</a>:
864 <a name="l00224"></a>00224                         this-&gt;<a class="code" href="classInspSocket.html#SetState_28InspSocketState_20s_29">SetState</a>(<a class="code" href="socket_8h.html#InspSocketStateI_5FCONNECTED">I_CONNECTED</a>);
865 <a name="l00225"></a>00225                         <span class="comment">/* Our socket was in write-state, so delete it and re-add it</span>
866 <a name="l00226"></a>00226 <span class="comment">                         * in read-state.</span>
867 <a name="l00227"></a>00227 <span class="comment">                         */</span>
868 <a name="l00228"></a>00228                         <a class="code" href="modules_8cpp.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#DelFd_28int_20fd_29">DelFd</a>(this-&gt;fd);
869 <a name="l00229"></a>00229                         <a class="code" href="modules_8cpp.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(this-&gt;fd,<span class="keyword">true</span>,<a class="code" href="socketengine_8h.html#X_5FESTAB_5FMODULE">X_ESTAB_MODULE</a>);
870 <a name="l00230"></a>00230                         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classInspSocket.html#OnConnected_28_29">OnConnected</a>();
871 <a name="l00231"></a>00231                 <span class="keywordflow">break</span>;
872 <a name="l00232"></a>00232                 <span class="keywordflow">case</span> <a class="code" href="socket_8h.html#InspSocketStateI_5FLISTENING">I_LISTENING</a>:
873 <a name="l00233"></a>00233                         <a class="code" href="classInspSocket.html#length">length</a> = <span class="keyword">sizeof</span> (<a class="code" href="classInspSocket.html#client">client</a>);
874 <a name="l00234"></a>00234                         incoming = accept (this-&gt;fd, (sockaddr*)&amp;<a class="code" href="classInspSocket.html#client">client</a>,&amp;<a class="code" href="classInspSocket.html#length">length</a>);
875 <a name="l00235"></a>00235                         this-&gt;<a class="code" href="classInspSocket.html#OnIncomingConnection_28int_20newfd_2C_20char_20_2Aip_29">OnIncomingConnection</a>(incoming,inet_ntoa(<a class="code" href="classInspSocket.html#client">client</a>.sin_addr));
876 <a name="l00236"></a>00236                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
877 <a name="l00237"></a>00237                 <span class="keywordflow">break</span>;
878 <a name="l00238"></a>00238                 <span class="keywordflow">case</span> <a class="code" href="socket_8h.html#InspSocketStateI_5FCONNECTED">I_CONNECTED</a>:
879 <a name="l00239"></a>00239                         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classInspSocket.html#OnDataReady_28_29">OnDataReady</a>();
880 <a name="l00240"></a>00240                 <span class="keywordflow">break</span>;
881 <a name="l00241"></a>00241                 <span class="keywordflow">default</span>:
882 <a name="l00242"></a>00242                 <span class="keywordflow">break</span>;
883 <a name="l00243"></a>00243         }
884 <a name="l00244"></a>00244 
885 <a name="l00245"></a>00245         <span class="keywordflow">return</span> <span class="keyword">true</span>;
886 <a name="l00246"></a>00246 }
887 </pre></div>
888 <p>
889     </td>
890   </tr>
891 </table>
892 <a class="anchor" name="Read_28_29"></a><!-- doxytag: member="InspSocket::Read" ref="Read_28_29" args="()" --><p>
893 <table class="mdTable" cellpadding="2" cellspacing="0">
894   <tr>
895     <td class="mdRow">
896       <table cellpadding="0" cellspacing="0" border="0">
897         <tr>
898           <td class="md" nowrap valign="top">char * InspSocket::Read           </td>
899           <td class="md" valign="top">(&nbsp;</td>
900           <td class="mdname1" valign="top" nowrap>          </td>
901           <td class="md" valign="top">&nbsp;)&nbsp;</td>
902           <td class="md" nowrap><code> [virtual]</code></td>
903         </tr>
904       </table>
905     </td>
906   </tr>
907 </table>
908 <table cellspacing="5" cellpadding="0" border="0">
909   <tr>
910     <td>
911       &nbsp;
912     </td>
913     <td>
914
915 <p>
916 Reads all pending bytes from the socket into a char* array which can be up to 16 kilobytes in length. 
917 <p>
918
919 <p>
920 Definition at line <a class="el" href="socket_8cpp-source.html#l00158">158</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
921 <p>
922 References <a class="el" href="inspircd__io_8h-source.html#l00028">DEBUG</a>, <a class="el" href="socket_8h-source.html#l00106">ibuf</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00159"></a>00159 {
923 <a name="l00160"></a>00160         <span class="keywordtype">int</span> n = recv(this-&gt;fd,this-&gt;ibuf,<span class="keyword">sizeof</span>(this-&gt;ibuf),0);
924 <a name="l00161"></a>00161         <span class="keywordflow">if</span> (n &gt; 0)
925 <a name="l00162"></a>00162         {
926 <a name="l00163"></a>00163                 <a class="code" href="classInspSocket.html#ibuf_5B_31_36_33_38_34_5D">ibuf</a>[n] = 0;
927 <a name="l00164"></a>00164                 <span class="keywordflow">return</span> <a class="code" href="classInspSocket.html#ibuf_5B_31_36_33_38_34_5D">ibuf</a>;
928 <a name="l00165"></a>00165         }
929 <a name="l00166"></a>00166         <span class="keywordflow">else</span>
930 <a name="l00167"></a>00167         {
931 <a name="l00168"></a>00168                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"EOF or error on socket"</span>);
932 <a name="l00169"></a>00169                 <span class="keywordflow">return</span> NULL;
933 <a name="l00170"></a>00170         }
934 <a name="l00171"></a>00171 }
935 </pre></div>
936 <p>
937     </td>
938   </tr>
939 </table>
940 <a class="anchor" name="SetState_28InspSocketState_20s_29"></a><!-- doxytag: member="InspSocket::SetState" ref="SetState_28InspSocketState_20s_29" args="(InspSocketState s)" --><p>
941 <table class="mdTable" cellpadding="2" cellspacing="0">
942   <tr>
943     <td class="mdRow">
944       <table cellpadding="0" cellspacing="0" border="0">
945         <tr>
946           <td class="md" nowrap valign="top">void InspSocket::SetState           </td>
947           <td class="md" valign="top">(&nbsp;</td>
948           <td class="md" nowrap valign="top"><a class="el" href="socket_8h.html#InspSocketState">InspSocketState</a>&nbsp;</td>
949           <td class="mdname1" valign="top" nowrap> <em>s</em>          </td>
950           <td class="md" valign="top">&nbsp;)&nbsp;</td>
951           <td class="md" nowrap></td>
952         </tr>
953       </table>
954     </td>
955   </tr>
956 </table>
957 <table cellspacing="5" cellpadding="0" border="0">
958   <tr>
959     <td>
960       &nbsp;
961     </td>
962     <td>
963
964 <p>
965 Changes the socket's state. 
966 <p>
967 The core uses this to change socket states, and you should not call it directly.
968 <p>
969 Definition at line <a class="el" href="socket_8cpp-source.html#l00248">248</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
970 <p>
971 References <a class="el" href="inspircd__io_8h-source.html#l00028">DEBUG</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, and <a class="el" href="socket_8h-source.html#l00072">state</a>.
972 <p>
973 Referenced by <a class="el" href="socket_8cpp-source.html#l00217">Poll()</a>.<div class="fragment"><pre class="fragment"><a name="l00249"></a>00249 {
974 <a name="l00250"></a>00250         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Socket state change"</span>);
975 <a name="l00251"></a>00251         this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = s;
976 <a name="l00252"></a>00252 }
977 </pre></div>
978 <p>
979     </td>
980   </tr>
981 </table>
982 <a class="anchor" name="Timeout_28time_5Ft_20current_29"></a><!-- doxytag: member="InspSocket::Timeout" ref="Timeout_28time_5Ft_20current_29" args="(time_t current)" --><p>
983 <table class="mdTable" cellpadding="2" cellspacing="0">
984   <tr>
985     <td class="mdRow">
986       <table cellpadding="0" cellspacing="0" border="0">
987         <tr>
988           <td class="md" nowrap valign="top">bool InspSocket::Timeout           </td>
989           <td class="md" valign="top">(&nbsp;</td>
990           <td class="md" nowrap valign="top">time_t&nbsp;</td>
991           <td class="mdname1" valign="top" nowrap> <em>current</em>          </td>
992           <td class="md" valign="top">&nbsp;)&nbsp;</td>
993           <td class="md" nowrap></td>
994         </tr>
995       </table>
996     </td>
997   </tr>
998 </table>
999 <table cellspacing="5" cellpadding="0" border="0">
1000   <tr>
1001     <td>
1002       &nbsp;
1003     </td>
1004     <td>
1005
1006 <p>
1007 This function checks if the socket has timed out yet, given the current time in the parameter. 
1008 <p>
1009 <dl compact><dt><b>Returns:</b></dt><dd>true if timed out, false if not timed out</dd></dl>
1010
1011 <p>
1012 Definition at line <a class="el" href="socket_8cpp-source.html#l00200">200</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.
1013 <p>
1014 References <a class="el" href="socket_8h.html#InspSocketStateI_5FCONNECTING">I_CONNECTING</a>, <a class="el" href="socket_8h.html#InspSocketErrorI_5FERR_5FTIMEOUT">I_ERR_TIMEOUT</a>, <a class="el" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>, <a class="el" href="socket_8cpp-source.html#l00265">OnError()</a>, <a class="el" href="socket_8cpp-source.html#l00269">OnTimeout()</a>, <a class="el" href="socket_8h-source.html#l00072">state</a>, <a class="el" href="socket_8h-source.html#l00097">timeout</a>, and <a class="el" href="socket_8h-source.html#l00091">timeout_end</a>.<div class="fragment"><pre class="fragment"><a name="l00201"></a>00201 {
1015 <a name="l00202"></a>00202         <span class="keywordflow">if</span> ((this-&gt;state == <a class="code" href="socket_8h.html#InspSocketStateI_5FCONNECTING">I_CONNECTING</a>) &amp;&amp; (current &gt; <a class="code" href="classInspSocket.html#timeout_5Fend">timeout_end</a>))
1016 <a name="l00203"></a>00203         {
1017 <a name="l00204"></a>00204                 <span class="comment">// for non-listening sockets, the timeout can occur</span>
1018 <a name="l00205"></a>00205                 <span class="comment">// which causes termination of the connection after</span>
1019 <a name="l00206"></a>00206                 <span class="comment">// the given number of seconds without a successful</span>
1020 <a name="l00207"></a>00207                 <span class="comment">// connection.</span>
1021 <a name="l00208"></a>00208                 this-&gt;<a class="code" href="classInspSocket.html#OnTimeout_28_29">OnTimeout</a>();
1022 <a name="l00209"></a>00209                 this-&gt;<a class="code" href="classInspSocket.html#OnError_28InspSocketError_20e_29">OnError</a>(<a class="code" href="socket_8h.html#InspSocketErrorI_5FERR_5FTIMEOUT">I_ERR_TIMEOUT</a>);
1023 <a name="l00210"></a>00210                 <a class="code" href="classInspSocket.html#timeout">timeout</a> = <span class="keyword">true</span>;
1024 <a name="l00211"></a>00211                 this-&gt;<a class="code" href="classInspSocket.html#state">state</a> = <a class="code" href="socket_8h.html#InspSocketStateI_5FERROR">I_ERROR</a>;
1025 <a name="l00212"></a>00212                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
1026 <a name="l00213"></a>00213         }
1027 <a name="l00214"></a>00214         <span class="keywordflow">return</span> <span class="keyword">false</span>;
1028 <a name="l00215"></a>00215 }
1029 </pre></div>
1030 <p>
1031     </td>
1032   </tr>
1033 </table>
1034 <a class="anchor" name="Write_28std_3A_3Astring_20data_29"></a><!-- doxytag: member="InspSocket::Write" ref="Write_28std_3A_3Astring_20data_29" args="(std::string data)" --><p>
1035 <table class="mdTable" cellpadding="2" cellspacing="0">
1036   <tr>
1037     <td class="mdRow">
1038       <table cellpadding="0" cellspacing="0" border="0">
1039         <tr>
1040           <td class="md" nowrap valign="top">int InspSocket::Write           </td>
1041           <td class="md" valign="top">(&nbsp;</td>
1042           <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td>
1043           <td class="mdname1" valign="top" nowrap> <em>data</em>          </td>
1044           <td class="md" valign="top">&nbsp;)&nbsp;</td>
1045           <td class="md" nowrap><code> [virtual]</code></td>
1046         </tr>
1047       </table>
1048     </td>
1049   </tr>
1050 </table>
1051 <table cellspacing="5" cellpadding="0" border="0">
1052   <tr>
1053     <td>
1054       &nbsp;
1055     </td>
1056     <td>
1057
1058 <p>
1059 Writes a <a class="el" href="namespaceirc.html#string">std::string</a> to the socket. 
1060 <p>
1061 No carriage returns or linefeeds are appended to the string. <dl compact><dt><b>Parameters:</b></dt><dd>
1062   <table border="0" cellspacing="2" cellpadding="0">
1063     <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>The data to send</td></tr>
1064   </table>
1065 </dl>
1066
1067 <p>
1068 Definition at line <a class="el" href="socket_8cpp-source.html#l00177">177</a> of file <a class="el" href="socket_8cpp-source.html">socket.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00178"></a>00178 {
1069 <a name="l00179"></a>00179         <span class="keywordtype">char</span>* d = (<span class="keywordtype">char</span>*)data.c_str();
1070 <a name="l00180"></a>00180         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> written = 0;
1071 <a name="l00181"></a>00181         <span class="keywordtype">int</span> n = 0;
1072 <a name="l00182"></a>00182         <span class="keywordtype">int</span> s = data.length();
1073 <a name="l00183"></a>00183         <span class="keywordflow">while</span> ((written &lt; data.length()) &amp;&amp; (n &gt;= 0))
1074 <a name="l00184"></a>00184         {
1075 <a name="l00185"></a>00185                 n = send(this-&gt;fd,d,s,0);
1076 <a name="l00186"></a>00186                 <span class="keywordflow">if</span> (n &gt; 0)
1077 <a name="l00187"></a>00187                 {
1078 <a name="l00188"></a>00188                         <span class="comment">// If we didnt write everything, advance</span>
1079 <a name="l00189"></a>00189                         <span class="comment">// the pointers so that when we retry</span>
1080 <a name="l00190"></a>00190                         <span class="comment">// the next time around the loop, we try</span>
1081 <a name="l00191"></a>00191                         <span class="comment">// to write what we failed to write before.</span>
1082 <a name="l00192"></a>00192                         written += n;
1083 <a name="l00193"></a>00193                         s -= n;
1084 <a name="l00194"></a>00194                         d += n;
1085 <a name="l00195"></a>00195                 }
1086 <a name="l00196"></a>00196         }
1087 <a name="l00197"></a>00197         <span class="keywordflow">return</span> written;
1088 <a name="l00198"></a>00198 }
1089 </pre></div>
1090 <p>
1091     </td>
1092   </tr>
1093 </table>
1094 <hr><h2>Member Data Documentation</h2>
1095 <a class="anchor" name="addr"></a><!-- doxytag: member="InspSocket::addr" ref="addr" args="" --><p>
1096 <table class="mdTable" cellpadding="2" cellspacing="0">
1097   <tr>
1098     <td class="mdRow">
1099       <table cellpadding="0" cellspacing="0" border="0">
1100         <tr>
1101           <td class="md" nowrap valign="top">sockaddr_in <a class="el" href="classInspSocket.html#addr">InspSocket::addr</a><code> [private]</code>          </td>
1102         </tr>
1103       </table>
1104     </td>
1105   </tr>
1106 </table>
1107 <table cellspacing="5" cellpadding="0" border="0">
1108   <tr>
1109     <td>
1110       &nbsp;
1111     </td>
1112     <td>
1113
1114 <p>
1115 The host being connected to, in sockaddr form. 
1116 <p>
1117
1118 <p>
1119 Definition at line <a class="el" href="socket_8h-source.html#l00078">78</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1120 <p>
1121 Referenced by <a class="el" href="socket_8cpp-source.html#l00062">InspSocket()</a>.    </td>
1122   </tr>
1123 </table>
1124 <a class="anchor" name="addy"></a><!-- doxytag: member="InspSocket::addy" ref="addy" args="" --><p>
1125 <table class="mdTable" cellpadding="2" cellspacing="0">
1126   <tr>
1127     <td class="mdRow">
1128       <table cellpadding="0" cellspacing="0" border="0">
1129         <tr>
1130           <td class="md" nowrap valign="top">in_addr <a class="el" href="classInspSocket.html#addy">InspSocket::addy</a><code> [private]</code>          </td>
1131         </tr>
1132       </table>
1133     </td>
1134   </tr>
1135 </table>
1136 <table cellspacing="5" cellpadding="0" border="0">
1137   <tr>
1138     <td>
1139       &nbsp;
1140     </td>
1141     <td>
1142
1143 <p>
1144 The host being connected to, in in_addr form. 
1145 <p>
1146
1147 <p>
1148 Definition at line <a class="el" href="socket_8h-source.html#l00084">84</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1149 <p>
1150 Referenced by <a class="el" href="socket_8cpp-source.html#l00062">InspSocket()</a>.    </td>
1151   </tr>
1152 </table>
1153 <a class="anchor" name="client"></a><!-- doxytag: member="InspSocket::client" ref="client" args="" --><p>
1154 <table class="mdTable" cellpadding="2" cellspacing="0">
1155   <tr>
1156     <td class="mdRow">
1157       <table cellpadding="0" cellspacing="0" border="0">
1158         <tr>
1159           <td class="md" nowrap valign="top">sockaddr_in <a class="el" href="classInspSocket.html#client">InspSocket::client</a><code> [private]</code>          </td>
1160         </tr>
1161       </table>
1162     </td>
1163   </tr>
1164 </table>
1165 <table cellspacing="5" cellpadding="0" border="0">
1166   <tr>
1167     <td>
1168       &nbsp;
1169     </td>
1170     <td>
1171
1172 <p>
1173 Client sockaddr structure used by accept(). 
1174 <p>
1175
1176 <p>
1177 Definition at line <a class="el" href="socket_8h-source.html#l00119">119</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1178 <p>
1179 Referenced by <a class="el" href="socket_8cpp-source.html#l00217">Poll()</a>.    </td>
1180   </tr>
1181 </table>
1182 <a class="anchor" name="fd"></a><!-- doxytag: member="InspSocket::fd" ref="fd" args="" --><p>
1183 <table class="mdTable" cellpadding="2" cellspacing="0">
1184   <tr>
1185     <td class="mdRow">
1186       <table cellpadding="0" cellspacing="0" border="0">
1187         <tr>
1188           <td class="md" nowrap valign="top">int <a class="el" href="classInspSocket.html#fd">InspSocket::fd</a><code> [private]</code>          </td>
1189         </tr>
1190       </table>
1191     </td>
1192   </tr>
1193 </table>
1194 <table cellspacing="5" cellpadding="0" border="0">
1195   <tr>
1196     <td>
1197       &nbsp;
1198     </td>
1199     <td>
1200
1201 <p>
1202 The file descriptor of this socket. 
1203 <p>
1204
1205 <p>
1206 Definition at line <a class="el" href="socket_8h-source.html#l00054">54</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1207 <p>
1208 Referenced by <a class="el" href="socket_8cpp-source.html#l00141">Close()</a>, <a class="el" href="socket_8cpp-source.html#l00259">GetFd()</a>, and <a class="el" href="socket_8cpp-source.html#l00053">InspSocket()</a>.    </td>
1209   </tr>
1210 </table>
1211 <a class="anchor" name="host"></a><!-- doxytag: member="InspSocket::host" ref="host" args="" --><p>
1212 <table class="mdTable" cellpadding="2" cellspacing="0">
1213   <tr>
1214     <td class="mdRow">
1215       <table cellpadding="0" cellspacing="0" border="0">
1216         <tr>
1217           <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> <a class="el" href="classInspSocket.html#host">InspSocket::host</a><code> [private]</code>          </td>
1218         </tr>
1219       </table>
1220     </td>
1221   </tr>
1222 </table>
1223 <table cellspacing="5" cellpadding="0" border="0">
1224   <tr>
1225     <td>
1226       &nbsp;
1227     </td>
1228     <td>
1229
1230 <p>
1231 The hostname connected to. 
1232 <p>
1233
1234 <p>
1235 Definition at line <a class="el" href="socket_8h-source.html#l00059">59</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.    </td>
1236   </tr>
1237 </table>
1238 <a class="anchor" name="ibuf_5B_31_36_33_38_34_5D"></a><!-- doxytag: member="InspSocket::ibuf" ref="ibuf_5B_31_36_33_38_34_5D" args="[16384]" --><p>
1239 <table class="mdTable" cellpadding="2" cellspacing="0">
1240   <tr>
1241     <td class="mdRow">
1242       <table cellpadding="0" cellspacing="0" border="0">
1243         <tr>
1244           <td class="md" nowrap valign="top">char <a class="el" href="classInspSocket.html#ibuf_5B_31_36_33_38_34_5D">InspSocket::ibuf</a>[16384]<code> [private]</code>          </td>
1245         </tr>
1246       </table>
1247     </td>
1248   </tr>
1249 </table>
1250 <table cellspacing="5" cellpadding="0" border="0">
1251   <tr>
1252     <td>
1253       &nbsp;
1254     </td>
1255     <td>
1256
1257 <p>
1258 Socket input buffer, used by read(). 
1259 <p>
1260 The class which extends InspSocket is expected to implement an extendable buffer which can grow much larger than 16k, this buffer is just designed to be temporary storage. space.
1261 <p>
1262 Definition at line <a class="el" href="socket_8h-source.html#l00106">106</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1263 <p>
1264 Referenced by <a class="el" href="socket_8cpp-source.html#l00158">Read()</a>.    </td>
1265   </tr>
1266 </table>
1267 <a class="anchor" name="IP"></a><!-- doxytag: member="InspSocket::IP" ref="IP" args="" --><p>
1268 <table class="mdTable" cellpadding="2" cellspacing="0">
1269   <tr>
1270     <td class="mdRow">
1271       <table cellpadding="0" cellspacing="0" border="0">
1272         <tr>
1273           <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> <a class="el" href="classInspSocket.html#IP">InspSocket::IP</a><code> [private]</code>          </td>
1274         </tr>
1275       </table>
1276     </td>
1277   </tr>
1278 </table>
1279 <table cellspacing="5" cellpadding="0" border="0">
1280   <tr>
1281     <td>
1282       &nbsp;
1283     </td>
1284     <td>
1285
1286 <p>
1287 The IP address being connected to stored in string form for easy retrieval by accessors. 
1288 <p>
1289
1290 <p>
1291 Definition at line <a class="el" href="socket_8h-source.html#l00113">113</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1292 <p>
1293 Referenced by <a class="el" href="socket_8cpp-source.html#l00153">GetIP()</a>, and <a class="el" href="socket_8cpp-source.html#l00053">InspSocket()</a>.    </td>
1294   </tr>
1295 </table>
1296 <a class="anchor" name="length"></a><!-- doxytag: member="InspSocket::length" ref="length" args="" --><p>
1297 <table class="mdTable" cellpadding="2" cellspacing="0">
1298   <tr>
1299     <td class="mdRow">
1300       <table cellpadding="0" cellspacing="0" border="0">
1301         <tr>
1302           <td class="md" nowrap valign="top">socklen_t <a class="el" href="classInspSocket.html#length">InspSocket::length</a><code> [private]</code>          </td>
1303         </tr>
1304       </table>
1305     </td>
1306   </tr>
1307 </table>
1308 <table cellspacing="5" cellpadding="0" border="0">
1309   <tr>
1310     <td>
1311       &nbsp;
1312     </td>
1313     <td>
1314
1315 <p>
1316 Used by accept() to indicate the sizes of the sockaddr_in structures. 
1317 <p>
1318
1319 <p>
1320 Definition at line <a class="el" href="socket_8h-source.html#l00131">131</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1321 <p>
1322 Referenced by <a class="el" href="socket_8cpp-source.html#l00217">Poll()</a>.    </td>
1323   </tr>
1324 </table>
1325 <a class="anchor" name="port"></a><!-- doxytag: member="InspSocket::port" ref="port" args="" --><p>
1326 <table class="mdTable" cellpadding="2" cellspacing="0">
1327   <tr>
1328     <td class="mdRow">
1329       <table cellpadding="0" cellspacing="0" border="0">
1330         <tr>
1331           <td class="md" nowrap valign="top">int <a class="el" href="classInspSocket.html#port">InspSocket::port</a><code> [private]</code>          </td>
1332         </tr>
1333       </table>
1334     </td>
1335   </tr>
1336 </table>
1337 <table cellspacing="5" cellpadding="0" border="0">
1338   <tr>
1339     <td>
1340       &nbsp;
1341     </td>
1342     <td>
1343
1344 <p>
1345 The port connected to, or the port this socket is listening on. 
1346 <p>
1347
1348 <p>
1349 Definition at line <a class="el" href="socket_8h-source.html#l00065">65</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.    </td>
1350   </tr>
1351 </table>
1352 <a class="anchor" name="server"></a><!-- doxytag: member="InspSocket::server" ref="server" args="" --><p>
1353 <table class="mdTable" cellpadding="2" cellspacing="0">
1354   <tr>
1355     <td class="mdRow">
1356       <table cellpadding="0" cellspacing="0" border="0">
1357         <tr>
1358           <td class="md" nowrap valign="top">sockaddr_in <a class="el" href="classInspSocket.html#server">InspSocket::server</a><code> [private]</code>          </td>
1359         </tr>
1360       </table>
1361     </td>
1362   </tr>
1363 </table>
1364 <table cellspacing="5" cellpadding="0" border="0">
1365   <tr>
1366     <td>
1367       &nbsp;
1368     </td>
1369     <td>
1370
1371 <p>
1372 <a class="el" href="classServer.html">Server</a> sockaddr structure used by accept(). 
1373 <p>
1374
1375 <p>
1376 Definition at line <a class="el" href="socket_8h-source.html#l00125">125</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.    </td>
1377   </tr>
1378 </table>
1379 <a class="anchor" name="state"></a><!-- doxytag: member="InspSocket::state" ref="state" args="" --><p>
1380 <table class="mdTable" cellpadding="2" cellspacing="0">
1381   <tr>
1382     <td class="mdRow">
1383       <table cellpadding="0" cellspacing="0" border="0">
1384         <tr>
1385           <td class="md" nowrap valign="top"><a class="el" href="socket_8h.html#InspSocketState">InspSocketState</a> <a class="el" href="classInspSocket.html#state">InspSocket::state</a><code> [private]</code>          </td>
1386         </tr>
1387       </table>
1388     </td>
1389   </tr>
1390 </table>
1391 <table cellspacing="5" cellpadding="0" border="0">
1392   <tr>
1393     <td>
1394       &nbsp;
1395     </td>
1396     <td>
1397
1398 <p>
1399 The state for this socket, either listening, connecting, connected or error. 
1400 <p>
1401
1402 <p>
1403 Definition at line <a class="el" href="socket_8h-source.html#l00072">72</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1404 <p>
1405 Referenced by <a class="el" href="socket_8cpp-source.html#l00254">GetState()</a>, <a class="el" href="socket_8cpp-source.html#l00048">InspSocket()</a>, <a class="el" href="socket_8cpp-source.html#l00248">SetState()</a>, and <a class="el" href="socket_8cpp-source.html#l00200">Timeout()</a>.    </td>
1406   </tr>
1407 </table>
1408 <a class="anchor" name="timeout"></a><!-- doxytag: member="InspSocket::timeout" ref="timeout" args="" --><p>
1409 <table class="mdTable" cellpadding="2" cellspacing="0">
1410   <tr>
1411     <td class="mdRow">
1412       <table cellpadding="0" cellspacing="0" border="0">
1413         <tr>
1414           <td class="md" nowrap valign="top">bool <a class="el" href="classInspSocket.html#timeout">InspSocket::timeout</a><code> [private]</code>          </td>
1415         </tr>
1416       </table>
1417     </td>
1418   </tr>
1419 </table>
1420 <table cellspacing="5" cellpadding="0" border="0">
1421   <tr>
1422     <td>
1423       &nbsp;
1424     </td>
1425     <td>
1426
1427 <p>
1428 This value is true if the socket has timed out. 
1429 <p>
1430
1431 <p>
1432 Definition at line <a class="el" href="socket_8h-source.html#l00097">97</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1433 <p>
1434 Referenced by <a class="el" href="socket_8cpp-source.html#l00062">InspSocket()</a>, and <a class="el" href="socket_8cpp-source.html#l00200">Timeout()</a>.    </td>
1435   </tr>
1436 </table>
1437 <a class="anchor" name="timeout_5Fend"></a><!-- doxytag: member="InspSocket::timeout_end" ref="timeout_5Fend" args="" --><p>
1438 <table class="mdTable" cellpadding="2" cellspacing="0">
1439   <tr>
1440     <td class="mdRow">
1441       <table cellpadding="0" cellspacing="0" border="0">
1442         <tr>
1443           <td class="md" nowrap valign="top">time_t <a class="el" href="classInspSocket.html#timeout_5Fend">InspSocket::timeout_end</a><code> [private]</code>          </td>
1444         </tr>
1445       </table>
1446     </td>
1447   </tr>
1448 </table>
1449 <table cellspacing="5" cellpadding="0" border="0">
1450   <tr>
1451     <td>
1452       &nbsp;
1453     </td>
1454     <td>
1455
1456 <p>
1457 When this time is reached, the socket times out if it is in the CONNECTING state. 
1458 <p>
1459
1460 <p>
1461 Definition at line <a class="el" href="socket_8h-source.html#l00091">91</a> of file <a class="el" href="socket_8h-source.html">socket.h</a>.
1462 <p>
1463 Referenced by <a class="el" href="socket_8cpp-source.html#l00062">InspSocket()</a>, and <a class="el" href="socket_8cpp-source.html#l00200">Timeout()</a>.    </td>
1464   </tr>
1465 </table>
1466 <hr>The documentation for this class was generated from the following files:<ul>
1467 <li><a class="el" href="socket_8h-source.html">socket.h</a><li><a class="el" href="socket_8cpp-source.html">socket.cpp</a></ul>
1468 <hr size="1"><address style="align: right;"><small>Generated on Wed Dec 14 19:16:26 2005 for InspIRCd by&nbsp;
1469 <a href="http://www.doxygen.org/index.html">
1470 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
1471 </body>
1472 </html>