diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02769.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02769.html | 2056 |
1 files changed, 2056 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02769.html b/docs/doxygen/nel/a02769.html new file mode 100644 index 00000000..1948bc32 --- /dev/null +++ b/docs/doxygen/nel/a02769.html @@ -0,0 +1,2056 @@ +<!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>NeL: NLNET::CListenSock class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<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">Data Structures</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">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLNET::CListenSock Class Reference</h1><code>#include <<a class="el" href="a05914.html">listen_sock.h</a>></code> +<p> +<p>Inheritance diagram for NLNET::CListenSock: +<p><center><img src="a02769.png" usemap="#NLNET::CListenSock_map" border="0" alt=""></center> +<map name="NLNET::CListenSock_map"> +<area href="a02445.html" alt="NLNET::CTcpSock" shape="rect" coords="0,56,128,80"> +<area href="a02444.html" alt="NLNET::CSock" shape="rect" coords="0,0,128,24"> +</map> +<hr><a name="_details"></a><h2>Detailed Description</h2> +<a class="el" href="a02769.html">CListenSock</a>: listening socket for servers. How to accept connections in a simple server:<ol> +<li>Create a <a class="el" href="a02769.html">CListenSock</a> object</li><li>Listen on the port you want the clients to connect</li><li>In a loop, accept a connection and store the new socket</li></ol> +<p> +<dl compact><dt><b>Author:</b></dt><dd>Olivier Cado <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2000-2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05914.html#l00047">47</a> of file <a class="el" href="a05914.html">listen_sock.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Receiving data</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockz2105_0">dataAvailable</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Checks if there is some data to receive, waiting (blocking) at most for the time out value. <a href="#NLNET_1_1CUdpSockz2105_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02444.html#NLNET_1_1CUdpSockw3">CSock::TSockResult</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CTcpSockz2105_1">receive</a> (<a class="el" href="a04558.html#a7">uint8</a> *<a class="el" href="a04223.html#a589">buffer</a>, <a class="el" href="a04558.html#a11">uint32</a> &<a class="el" href="a04223.html#a571">len</a>, bool throw_exception=true)</td></tr> + +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockw3">TSockResult</a> { <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw2">Ok</a>, +<a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw4">WouldBlock</a>, +<a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw0">ConnectionClosed</a>, +<a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw1">Error</a> + }</td></tr> + +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02445.html">CTcpSock</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSocka0">accept</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Blocks until an incoming connection is requested, accepts it, and creates a new socket (you have to delete it after use). <a href="#NLNET_1_1CListenSocka0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocka0">bytesReceived</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes received since the latest connection. <a href="#NLNET_1_1CUdpSocka0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocka1">bytesSent</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes sent since the latest connection. <a href="#NLNET_1_1CUdpSocka1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSocka3">CListenSock</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NLNET_1_1CListenSocka3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocka2">getSendBufferSize</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the send buffer size. <a href="#NLNET_1_1CUdpSocka2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocka3">setSendBufferSize</a> (<a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the send buffer size. <a href="#NLNET_1_1CUdpSocka3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocka4">setTimeOutValue</a> (long sec, long ms)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Change the time out value used in getDataAvailable(), which is 0 by default. <a href="#NLNET_1_1CUdpSocka4"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Socket setup</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_1">connectWithCustomWindowSize</a> (const <a class="el" href="a02665.html">CInetAddress</a> &<a class="el" href="a04223.html#a657">addr</a>, int windowsize)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_5">getWindowSize</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the TCP Window Size for the current socket. <a href="#NLNET_1_1CTcpSockz2111_5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_7">shutdownReceiving</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Active disconnection for download way only (partial shutdown). <a href="#NLNET_1_1CTcpSockz2111_7"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_8">shutdownSending</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Active disconnection for upload way only (partial shutdown). <a href="#NLNET_1_1CTcpSockz2111_8"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Socket setup</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSockz2083_0">backlog</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the pending connections queue. <a href="#NLNET_1_1CListenSockz2083_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSockz2083_1">init</a> (const <a class="el" href="a02665.html">CInetAddress</a> &<a class="el" href="a04223.html#a657">addr</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Prepares to receive connections on a specified address/port (useful when the host has several addresses). <a href="#NLNET_1_1CListenSockz2083_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSockz2083_2">init</a> (<a class="el" href="a04558.html#a9">uint16</a> port)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Prepares to receive connections on a specified port (bind+listen). <a href="#NLNET_1_1CListenSockz2083_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSockz2083_3">setBacklog</a> (<a class="el" href="a04558.html#a14">sint</a> backlog)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the number of the pending connections queue, or -1 for the maximum possible value. <a href="#NLNET_1_1CListenSockz2083_3"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Socket setup</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_0">connect</a> (const <a class="el" href="a02665.html">CInetAddress</a> &<a class="el" href="a04223.html#a657">addr</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_1">connectWithCustomWindowSize</a> (const <a class="el" href="a02665.html">CInetAddress</a> &<a class="el" href="a04223.html#a657">addr</a>, int windowsize)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_4">disconnect</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Active disconnection (shutdown) (mutexed). <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2109_0">connected()</a> becomes false. <a href="#NLNET_1_1CTcpSockz2111_4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_5">getWindowSize</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the TCP Window Size for the current socket. <a href="#NLNET_1_1CTcpSockz2111_5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_6">setNoDelay</a> (bool <a class="el" href="a04223.html#a658">value</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_7">shutdownReceiving</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Active disconnection for download way only (partial shutdown). <a href="#NLNET_1_1CTcpSockz2111_7"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_8">shutdownSending</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Active disconnection for upload way only (partial shutdown). <a href="#NLNET_1_1CTcpSockz2111_8"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocke0">errorString</a> (<a class="el" href="a04558.html#a15">uint</a> errorcode)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a string explaining the network error (see <a class="el" href="a02444.html#NLNET_1_1CUdpSocke1">getLastError()</a>). <a href="#NLNET_1_1CUdpSocke0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocke1">getLastError</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocke2">initialized</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the network engine is initialized. <a href="#NLNET_1_1CUdpSocke2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocke3">initNetwork</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the network engine, if it is not already done. <a href="#NLNET_1_1CUdpSocke3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSocke4">releaseNetwork</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Releases the network engine. <a href="#NLNET_1_1CUdpSocke4"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockb0">createSocket</a> (int <a class="el" href="a04223.html#a581">type</a>, int protocol)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates the socket and get a valid descriptor. <a href="#NLNET_1_1CUdpSockb0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockb1">setLocalAddress</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the local address. <a href="#NLNET_1_1CUdpSockb1"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp0">_BytesReceived</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of bytes received on this socket. <a href="#NLNET_1_1CUdpSockp0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp1">_BytesSent</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of bytes sent on this socket. <a href="#NLNET_1_1CUdpSockp1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>volatile bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp2">_Connected</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">True after calling <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2103_1">connect()</a>. <a href="#NLNET_1_1CUdpSockp2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02665.html">CInetAddress</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp3">_LocalAddr</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Address of local host (valid if connected). <a href="#NLNET_1_1CUdpSockp3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp4">_Logging</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If false, do not log any information. <a href="#NLNET_1_1CUdpSockp4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp5">_NonBlocking</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If true, the socket is in nonblocking mode. <a href="#NLNET_1_1CUdpSockp5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02665.html">CInetAddress</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp6">_RemoteAddr</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Address of the remote host (valid if connected). <a href="#NLNET_1_1CUdpSockp6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>SOCKET </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Socket descriptor. <a href="#NLNET_1_1CUdpSockp7"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp8">_TimeoutMs</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Secondary time out value (ms) for select in <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2105_0">dataAvailable()</a>. <a href="#NLNET_1_1CUdpSockp8"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="a02444.html#NLNET_1_1CUdpSockp9">_TimeoutS</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Main time out value (sec) for select in <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2105_0">dataAvailable()</a>. <a href="#NLNET_1_1CUdpSockp9"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSockr0">_BackLog</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02769.html#NLNET_1_1CListenSockr1">_Bound</a></td></tr> + +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NLNET_1_1CUdpSockw3" doxytag="NLNET::CListenSock::TSockResult" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> enum <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3">NLNET::CSock::TSockResult</a><code> [inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw2" doxytag="Ok" ></a>Ok</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw4" doxytag="WouldBlock" ></a>WouldBlock</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw0" doxytag="ConnectionClosed" ></a>ConnectionClosed</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw1" doxytag="Error" ></a>Error</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a06405.html#l00125">125</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +<div class="fragment"><pre>00125 { <a class="code" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw2">Ok</a>, <a class="code" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw4">WouldBlock</a>, <a class="code" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw0">ConnectionClosed</a>, <a class="code" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw1">Error</a> }; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLNET_1_1CListenSocka3" doxytag="NLNET::CListenSock::CListenSock" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLNET::CListenSock::CListenSock </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000034">Todo:</a></b></dt><dd>cado: tune backlog value, not too small, not to big (20-200) to prevent SYN attacks (see <a href="http://www.cyberport.com/~tangent/programming/winsock/advanced.html">http://www.cyberport.com/~tangent/programming/winsock/advanced.html</a>)</dd></dl> + +<p> +Definition at line <a class="el" href="a05913.html#l00063">63</a> of file <a class="el" href="a05913.html">listen_sock.cpp</a>. +<p> +References <a class="el" href="a02444.html#NLNET_1_1CUdpSockb0">NLNET::CSock::createSocket()</a>, and <a class="el" href="a05913.html#l00158">setBacklog()</a>. +<p> +<div class="fragment"><pre>00063 : <a class="code" href="a02445.html#NLNET_1_1CTcpSockz2111_3">CTcpSock</a>(), <a class="code" href="a02769.html#NLNET_1_1CListenSockr1">_Bound</a>( <span class="keyword">false</span> ) +00064 { +00065 <span class="comment">// Create socket</span> +00066 <a class="code" href="a02444.html#NLNET_1_1CUdpSockb0">createSocket</a>( SOCK_STREAM, IPPROTO_TCP ); +00067 +00069 <a class="code" href="a02769.html#NLNET_1_1CListenSockz2083_3">setBacklog</a>( -1 ); +00070 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLNET_1_1CListenSocka0" doxytag="NLNET::CListenSock::accept" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02445.html">CTcpSock</a> * NLNET::CListenSock::accept </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Blocks until an incoming connection is requested, accepts it, and creates a new socket (you have to delete it after use). +<p> + +<p> +Definition at line <a class="el" href="a05913.html#l00129">129</a> of file <a class="el" href="a05913.html">listen_sock.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01127">addr</a>, <a class="el" href="a06487.html#l00061">NLNET::CTcpSock::CTcpSock()</a>, and <a class="el" href="a05622.html#l00101">nldebug</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>. +<p> +<div class="fragment"><pre>00130 { +00131 <span class="comment">// Accept connection</span> +00132 sockaddr_in saddr; +00133 socklen_t saddrlen = <span class="keyword">sizeof</span>(saddr); +00134 SOCKET newsock = ::accept( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>, (sockaddr*)&saddr, &saddrlen ); +00135 <span class="keywordflow">if</span> ( newsock == INVALID_SOCKET ) +00136 { +00137 <span class="comment">/*nlinfo( "LNETL0: Error accepting a connection");</span> +00138 <span class="comment"> // See accept() man on Linux</span> +00139 <span class="comment"> newsock = ::accept( _Sock, (sockaddr*)&saddr, &saddrlen );</span> +00140 <span class="comment"> if ( newsock == INVALID_SOCKET )*/</span> +00141 { +00142 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"Accept returned an invalid socket"</span>); +00143 } +00144 } +00145 +00146 <span class="comment">// Construct and save a CTcpSock object</span> +00147 <a class="code" href="a02665.html">CInetAddress</a> <a class="code" href="a04223.html#a657">addr</a>; +00148 <a class="code" href="a04223.html#a657">addr</a>.setSockAddr( &saddr ); +00149 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL0: Socket %d accepted an incoming connection from %s, opening socket %d"</span>, _Sock, <a class="code" href="a04223.html#a657">addr</a>.asString().c_str(), newsock ); +00150 <a class="code" href="a02445.html#NLNET_1_1CTcpSockz2111_3">CTcpSock</a> *connection = <span class="keyword">new</span> <a class="code" href="a02445.html#NLNET_1_1CTcpSockz2111_3">CTcpSock</a>( newsock, addr ); +00151 <span class="keywordflow">return</span> connection; +00152 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CListenSockz2083_0" doxytag="NLNET::CListenSock::backlog" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> NLNET::CListenSock::backlog </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the pending connections queue. +<p> + +<p> +Definition at line <a class="el" href="a05914.html#l00067">67</a> of file <a class="el" href="a05914.html">listen_sock.h</a>. +<p> +References <a class="el" href="a05914.html#l00078">_BackLog</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +<div class="fragment"><pre>00067 { <span class="keywordflow">return</span> <a class="code" href="a02769.html#NLNET_1_1CListenSockr0">_BackLog</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocka0" doxytag="NLNET::CListenSock::bytesReceived" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> NLNET::CSock::bytesReceived </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the number of bytes received since the latest connection. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00249">249</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a05981.html#l00102">uint64</a>. +<p> +Referenced by <a class="el" href="a05507.html#l00172">NLNET::CBufClient::bytesDownloaded()</a>. +<p> +<div class="fragment"><pre>00249 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp0">_BytesReceived</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocka1" doxytag="NLNET::CListenSock::bytesSent" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> NLNET::CSock::bytesSent </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the number of bytes sent since the latest connection. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00252">252</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a05981.html#l00102">uint64</a>. +<p> +Referenced by <a class="el" href="a05507.html#l00175">NLNET::CBufClient::bytesUploaded()</a>. +<p> +<div class="fragment"><pre>00252 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp1">_BytesSent</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2103_0" doxytag="NLNET::CListenSock::close" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual void NLNET::CSock::close </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Closes the socket (without shutdown) In general you don't need to call this method. But you can call it to:<ul> +<li>close a listening socket (i.e. stop accepting connections), or</li><li>stop a select() in progress in another thread (in this case, just calling the destructor is not enough)</li></ul> + +<p> +Reimplemented in <a class="el" href="a02443.html#NLNET_1_1CDummyTcpSocka3">NLNET::CDummyTcpSock</a>. +<p> +Referenced by <a class="el" href="a06641.html#l00231">NLNET::CUdpSimSock::close()</a>, <a class="el" href="a05513.html#l00101">NLNET::CListenTask::close()</a>, <a class="el" href="a06487.html#l00080">NLNET::CTcpSock::connect()</a>, and <a class="el" href="a05670.html#l00128">NLNET::sendEmail()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_0" doxytag="NLNET::CListenSock::connect" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CTcpSock::connect </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02665.html">CInetAddress</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>addr</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Connection. You can reconnect a socket after being disconnected. This method does not return a boolean, otherwise a programmer could ignore the result and no exception would be thrown if connection fails :<ul> +<li>If addr is not valid, an exception <a class="el" href="a03810.html">ESocket</a> is thrown</li><li>If <a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_0">connect()</a> fails for another reason, an exception <a class="el" href="a03812.html">ESocketConnectionFailed</a> is thrown</li></ul> + +<p> +Reimplemented from <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2103_1">NLNET::CSock</a>. +<p> +Reimplemented in <a class="el" href="a02443.html#NLNET_1_1CDummyTcpSocka4">NLNET::CDummyTcpSock</a>. +<p> +Definition at line <a class="el" href="a06487.html#l00080">80</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01127">addr</a>, <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2103_0">NLNET::CSock::close()</a>, and <a class="el" href="a02444.html#NLNET_1_1CUdpSockb0">NLNET::CSock::createSocket()</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00295">NLNET::CBufSock::connect()</a>, and <a class="el" href="a05670.html#l00128">NLNET::sendEmail()</a>. +<p> +<div class="fragment"><pre>00081 { +00082 <span class="comment">// Create a new socket</span> +00083 <span class="keywordflow">if</span> ( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a> != INVALID_SOCKET ) +00084 { +00085 <span class="keywordflow">if</span> ( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp4">_Logging</a> ) +00086 { +00087 <span class="comment">// nldebug( "LNETL0: Closing socket %d before reconnecting", _Sock );</span> +00088 } +00089 <a class="code" href="a02444.html#NLNET_1_1CUdpSockz2103_0">close</a>(); +00090 } +00091 <a class="code" href="a02444.html#NLNET_1_1CUdpSockb0">createSocket</a>( SOCK_STREAM, IPPROTO_TCP ); +00092 +00093 <span class="comment">// Connection</span> +00094 CSock::connect( addr ); +00095 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2109_0" doxytag="NLNET::CListenSock::connected" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLNET::CSock::connected </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns if the socket is connected (mutexed). +<p> + +<p> +Referenced by <a class="el" href="a05524.html#l00286">NLNET::CCallbackClient::connect()</a>, <a class="el" href="a05514.html#l00295">NLNET::CBufSock::connect()</a>, <a class="el" href="a05506.html#l00085">NLNET::CBufClient::connect()</a>, <a class="el" href="a06641.html#l00306">NLNET::CUdpSimSock::connected()</a>, <a class="el" href="a05958.html#l00101">NLNET::CLoginClient::connectToShard()</a>, <a class="el" href="a05512.html#l00251">NLNET::CBufServer::disconnect()</a>, <a class="el" href="a05506.html#l00318">NLNET::CBufClient::disconnect()</a>, <a class="el" href="a05515.html#l00178">NLNET::CBufSock::pushBuffer()</a>, <a class="el" href="a05670.html#l00128">NLNET::sendEmail()</a>, <a class="el" href="a05506.html#l00296">NLNET::CBufClient::update()</a>, and <a class="el" href="a05506.html#l00397">NLNET::CBufClient::~CBufClient()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_1" doxytag="NLNET::CListenSock::connectWithCustomWindowSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CTcpSock::connectWithCustomWindowSize </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02665.html">CInetAddress</a> & </td> + <td class="mdname" nowrap> <em>addr</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>windowsize</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets a custom TCP Window size (SO_RCVBUF and SO_SNDBUF). You must close the socket is necessary, before calling this method.<p> +See <a href="http://www.ncsa.uiuc.edu/People/vwelch/net_perf/tcp_windows.html">http://www.ncsa.uiuc.edu/People/vwelch/net_perf/tcp_windows.html</a> +<p> +Definition at line <a class="el" href="a06487.html#l00161">161</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01127">addr</a>, <a class="el" href="a02444.html#NLNET_1_1CUdpSockb0">NLNET::CSock::createSocket()</a>, and <a class="el" href="a05622.html#l00154">nlerror</a>. +<p> +<div class="fragment"><pre>00162 { +00163 <span class="comment">// Create socket</span> +00164 <span class="keywordflow">if</span> ( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a> != INVALID_SOCKET ) +00165 { +00166 <a class="code" href="a04199.html#a3">nlerror</a>( <span class="stringliteral">"Cannot connect with custom window size when already connected"</span> ); +00167 } +00168 <a class="code" href="a02444.html#NLNET_1_1CUdpSockb0">createSocket</a>( SOCK_STREAM, IPPROTO_TCP ); +00169 +00170 <span class="comment">// Change window size</span> +00171 <span class="keywordflow">if</span> ( setsockopt( _Sock, SOL_SOCKET, SO_SNDBUF, (<span class="keywordtype">char</span>*)&windowsize, <span class="keyword">sizeof</span>(windowsize) ) != 0 +00172 || setsockopt( _Sock, SOL_SOCKET, SO_RCVBUF, (<span class="keywordtype">char</span>*)&windowsize, <span class="keyword">sizeof</span>(windowsize) ) != 0 ) +00173 { +00174 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"setWindowSize failed"</span> ); +00175 } +00176 +00177 <span class="comment">// Connection</span> +00178 CSock::connect( addr ); +00179 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockb0" doxytag="NLNET::CListenSock::createSocket" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::createSocket </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">int </td> + <td class="mdname" nowrap> <em>type</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>int </td> + <td class="mdname" nowrap> <em>protocol</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Creates the socket and get a valid descriptor. +<p> + +<p> +Referenced by <a class="el" href="a05913.html#l00063">CListenSock()</a>, <a class="el" href="a06487.html#l00080">NLNET::CTcpSock::connect()</a>, <a class="el" href="a06487.html#l00161">NLNET::CTcpSock::connectWithCustomWindowSize()</a>, and <a class="el" href="a06643.html#l00062">NLNET::CUdpSock::CUdpSock()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2105_0" doxytag="NLNET::CListenSock::dataAvailable" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLNET::CSock::dataAvailable </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Checks if there is some data to receive, waiting (blocking) at most for the time out value. +<p> + +<p> +Referenced by <a class="el" href="a06641.html#l00238">NLNET::CUdpSimSock::dataAvailable()</a>, and <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2109_1" doxytag="NLNET::CListenSock::descriptor" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> SOCKET NLNET::CSock::descriptor </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the socket descriptor. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00241">241</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a06405.html#l00281">NLNET::CSock::_Sock</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00329">NLNET::CBufSock::asString()</a>, and <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>. +<p> +<div class="fragment"><pre>00241 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_4" doxytag="NLNET::CListenSock::disconnect" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CTcpSock::disconnect </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Active disconnection (shutdown) (mutexed). <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2109_0">connected()</a> becomes false. +<p> + +<p> +Reimplemented in <a class="el" href="a02443.html#NLNET_1_1CDummyTcpSocka5">NLNET::CDummyTcpSock</a>. +<p> +Definition at line <a class="el" href="a06487.html#l00101">101</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +References <a class="el" href="a05810.html#l00385">NLNET::CInetAddress::asString()</a>, and <a class="el" href="a05622.html#l00101">nldebug</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00315">NLNET::CBufSock::disconnect()</a>, <a class="el" href="a05512.html#l00251">NLNET::CBufServer::disconnect()</a>, <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>, and <a class="el" href="a05506.html#l00296">NLNET::CBufClient::update()</a>. +<p> +<div class="fragment"><pre>00102 { +00103 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL0: Socket %d disconnecting from %s..."</span>, _Sock, <a class="code" href="a02444.html#NLNET_1_1CUdpSockp6">_RemoteAddr</a>.<a class="code" href="a02665.html#NLNET_1_1CInetAddressa1">asString</a>().c_str() ); +00104 +00105 <span class="comment">// This shutdown resets the connection immediatly (not a graceful closure)</span> +00106 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span> +00107 <span class="preprocessor"></span> ::shutdown( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>, SD_BOTH ); +00108 <span class="preprocessor">#elif defined NL_OS_UNIX</span> +00109 <span class="preprocessor"></span> ::shutdown( _Sock, SHUT_RDWR ); +00110 <span class="preprocessor">#endif</span> +00111 <span class="preprocessor"></span> <span class="comment">/*CSynchronized<bool>::CAccessor sync( &_SyncConnected );</span> +00112 <span class="comment"> sync.value() = false;*/</span> +00113 <a class="code" href="a02444.html#NLNET_1_1CUdpSockp2">_Connected</a> = <span class="keyword">false</span>; +00114 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocke0" doxytag="NLNET::CListenSock::errorString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::string NLNET::CSock::errorString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>errorcode</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns a string explaining the network error (see <a class="el" href="a02444.html#NLNET_1_1CUdpSocke1">getLastError()</a>). +<p> + </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocke1" doxytag="NLNET::CListenSock::getLastError" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLNET::CSock::getLastError </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the code of the last error that has occured. Note: This code is platform-dependant. On Unix, it is errno; on Windows it is the Winsock error code. See also <a class="el" href="a02444.html#NLNET_1_1CUdpSocke0">errorString()</a> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocka2" doxytag="NLNET::CListenSock::getSendBufferSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> NLNET::CSock::getSendBufferSize </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Gets the send buffer size. +<p> + </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_5" doxytag="NLNET::CListenSock::getWindowSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CTcpSock::getWindowSize </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the TCP Window Size for the current socket. +<p> + +<p> +Definition at line <a class="el" href="a06487.html#l00185">185</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +References <a class="el" href="a05646.html#l00235">len</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00186 { +00187 <span class="keywordtype">int</span> windowsize = 0; +00188 socklen_t <a class="code" href="a04223.html#a571">len</a> = <span class="keyword">sizeof</span>( windowsize ); +00189 +00190 <span class="comment">/* send buffer -- query for buffer size */</span> +00191 <span class="keywordflow">if</span> ( getsockopt( _Sock, SOL_SOCKET, SO_SNDBUF, (<span class="keywordtype">char</span>*) &windowsize, &len ) == 0 ) +00192 { +00193 <span class="keywordflow">return</span> windowsize; +00194 } +00195 <span class="keywordflow">else</span> +00196 { +00197 <span class="keywordflow">return</span> 0; +00198 } +00199 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CListenSockz2083_1" doxytag="NLNET::CListenSock::init" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CListenSock::init </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02665.html">CInetAddress</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>addr</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Prepares to receive connections on a specified address/port (useful when the host has several addresses). +<p> + +<p> +Definition at line <a class="el" href="a05913.html#l00093">93</a> of file <a class="el" href="a05913.html">listen_sock.cpp</a>. +<p> +References <a class="el" href="a05914.html#l00078">_BackLog</a>, <a class="el" href="a05914.html#l00076">_Bound</a>, <a class="el" href="a05646.html#l01127">addr</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, and <a class="el" href="a05646.html#l01132">value</a>. +<p> +<div class="fragment"><pre>00094 { +00095 <span class="keywordflow">if</span> ( ! <a class="code" href="a04223.html#a657">addr</a>.isValid() ) +00096 { +00097 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL0: Binding listen socket to any address, port %hu"</span>, <a class="code" href="a04223.html#a657">addr</a>.port() ); +00098 } +00099 +00100 <span class="preprocessor">#ifndef NL_OS_WINDOWS</span> +00101 <span class="preprocessor"></span> <span class="comment">// Set Reuse Address On (does not work on Win98 and is useless on Win2000)</span> +00102 <span class="keywordtype">int</span> <a class="code" href="a04223.html#a658">value</a> = <span class="keyword">true</span>; +00103 <span class="keywordflow">if</span> ( setsockopt( _Sock, SOL_SOCKET, SO_REUSEADDR, &value, <span class="keyword">sizeof</span>(value) ) == SOCKET_ERROR ) +00104 { +00105 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"ReuseAddr failed"</span> ); +00106 } +00107 <span class="preprocessor">#endif</span> +00108 <span class="preprocessor"></span> +00109 <span class="comment">// Bind socket to port </span> +00110 <span class="keywordflow">if</span> ( ::bind( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>, (<span class="keyword">const</span> sockaddr *)<a class="code" href="a04223.html#a657">addr</a>.sockAddr(), <span class="keyword">sizeof</span>(sockaddr_in) ) != 0 ) +00111 { +00112 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"Unable to bind listen socket to port"</span> ); +00113 } +00114 <a class="code" href="a02444.html#NLNET_1_1CUdpSockp3">_LocalAddr</a> = <a class="code" href="a04223.html#a657">addr</a>; +00115 <a class="code" href="a02769.html#NLNET_1_1CListenSockr1">_Bound</a> = <span class="keyword">true</span>; +00116 +00117 <span class="comment">// Listen</span> +00118 <span class="keywordflow">if</span> ( ::listen( _Sock, <a class="code" href="a02769.html#NLNET_1_1CListenSockr0">_BackLog</a> ) != 0 ) <span class="comment">// SOMAXCONN = maximum length of the queue of pending connections</span> +00119 { +00120 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"Unable to listen on specified port"</span> ); +00121 } +00122 <span class="comment">// nldebug( "LNETL0: Socket %d listening at %s", _Sock, _LocalAddr.asString().c_str() );</span> +00123 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CListenSockz2083_2" doxytag="NLNET::CListenSock::init" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CListenSock::init </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a9">uint16</a> </td> + <td class="mdname1" valign="top" nowrap> <em>port</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Prepares to receive connections on a specified port (bind+listen). +<p> + +<p> +Definition at line <a class="el" href="a05913.html#l00076">76</a> of file <a class="el" href="a05913.html">listen_sock.cpp</a>. +<p> +References <a class="el" href="a05810.html#l00385">NLNET::CInetAddress::asString()</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05810.html#l00262">NLNET::CInetAddress::setPort()</a>, and <a class="el" href="a05981.html#l00098">uint16</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00111">NLNET::CListenTask::init()</a>. +<p> +<div class="fragment"><pre>00077 { +00078 <span class="comment">// Use any address</span> +00079 <a class="code" href="a02665.html">CInetAddress</a> localaddr; <span class="comment">// By default, INETADDR_ANY (useful for gateways that have several ip addresses)</span> +00080 localaddr.<a class="code" href="a02665.html#NLNET_1_1CInetAddressa17">setPort</a>( port ); +00081 <a class="code" href="a02769.html#NLNET_1_1CListenSockz2083_2">init</a>( localaddr ); +00082 +00083 <span class="comment">// Now set the address visible from outside</span> +00084 <a class="code" href="a02444.html#NLNET_1_1CUdpSockp3">_LocalAddr</a> = <a class="code" href="a02665.html#NLNET_1_1CInetAddresse1">CInetAddress::localHost</a>(); +00085 <a class="code" href="a02444.html#NLNET_1_1CUdpSockp3">_LocalAddr</a>.<a class="code" href="a02665.html#NLNET_1_1CInetAddressa17">setPort</a>( port ); +00086 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL0: Socket %d listen socket is at %s"</span>, _Sock, <a class="code" href="a02444.html#NLNET_1_1CUdpSockp3">_LocalAddr</a>.<a class="code" href="a02665.html#NLNET_1_1CInetAddressa1">asString</a>().c_str() ); +00087 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocke2" doxytag="NLNET::CListenSock::initialized" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLNET::CSock::initialized </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns true if the network engine is initialized. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00261">261</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +<div class="fragment"><pre>00261 { <span class="keywordflow">return</span> CSock::_Initialized; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocke3" doxytag="NLNET::CListenSock::initNetwork" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::initNetwork </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Initialize the network engine, if it is not already done. +<p> + </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2109_2" doxytag="NLNET::CListenSock::localAddr" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a02665.html">CInetAddress</a>& NLNET::CSock::localAddr </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns a const reference on the local address. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00235">235</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a06405.html#l00284">NLNET::CSock::_LocalAddr</a>. +<p> +Referenced by <a class="el" href="a05962.html#l00353">NLNET::CLoginServer::init()</a>, <a class="el" href="a06642.html#l00066">NLNET::CUdpSimSock::localAddr()</a>, and <a class="el" href="a05513.html#l00104">NLNET::CListenTask::localAddr()</a>. +<p> +<div class="fragment"><pre>00235 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp3">_LocalAddr</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2103_2" doxytag="NLNET::CListenSock::nonBlockingMode" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLNET::CSock::nonBlockingMode </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the nonblocking mode. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00166">166</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a06405.html#l00293">NLNET::CSock::_NonBlocking</a>. +<p> +<div class="fragment"><pre>00166 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp5">_NonBlocking</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2105_1" doxytag="NLNET::CListenSock::receive" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3">CSock::TSockResult</a> NLNET::CSock::receive </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a7">uint8</a> * </td> + <td class="mdname" nowrap> <em>buffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> & </td> + <td class="mdname" nowrap> <em>len</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>throw_exception</em> = true</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Receive a partial or an entire block of data, depending on nonblocking mode.<p> +In blocking mode: the method waits until 'len' bytes have been received.<p> +In nonblocking mode: the method reads the bytes that have already been received only, and resets 'len' to the number of bytes read. The actual length may be smaller than the demanded length. In no data is available, the return value is <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw4">CSock::WouldBlock</a>. If <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2105_0">dataAvailable()</a> returns true, you are sure that <a class="el" href="a02444.html#NLNET_1_1CTcpSockz2105_1">receive()</a> will not return <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw4">CSock::WouldBlock</a>.<p> +In case of graceful disconnection:<ul> +<li><a class="el" href="a02444.html#NLNET_1_1CUdpSockz2109_0">connected()</a> become false</li><li>the return value is <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw0">CSock::ConnectionClosed</a> or an <a class="el" href="a03811.html">ESocketConnectionClosed</a> exception is thrown.</li></ul> +<p> +In case of failure (e.g. connection reset by peer) :<ul> +<li>the return value is <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw1">CSock::Error</a> or an <a class="el" href="a03810.html">ESocket</a> exception is thrown. You may want to close the connection manually.</li></ul> + +<p> +Reimplemented in <a class="el" href="a03628.html#NLNET_1_1CUdpSockz2115_0">NLNET::CUdpSock</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00386">NLNET::CNonBlockingBufSock::receivePart()</a>, and <a class="el" href="a05670.html#l00086">NLNET::sendEMailCommand()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocke4" doxytag="NLNET::CListenSock::releaseNetwork" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::releaseNetwork </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Releases the network engine. +<p> + </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2109_3" doxytag="NLNET::CListenSock::remoteAddr" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a02665.html">CInetAddress</a>& NLNET::CSock::remoteAddr </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the address of the remote host. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00238">238</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a06405.html#l00287">NLNET::CSock::_RemoteAddr</a>. +<p> +Referenced by <a class="el" href="a05513.html#l00241">NLNET::CBufServer::hostAddress()</a>, <a class="el" href="a05514.html#l00386">NLNET::CNonBlockingBufSock::receivePart()</a>, <a class="el" href="a05507.html#l00169">NLNET::CBufClient::remoteAddress()</a>, and <a class="el" href="a05670.html#l00086">NLNET::sendEMailCommand()</a>. +<p> +<div class="fragment"><pre>00238 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp6">_RemoteAddr</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2107_0" doxytag="NLNET::CListenSock::send" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3">CSock::TSockResult</a> NLNET::CSock::send </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a04558.html#a7">uint8</a> * </td> + <td class="mdname" nowrap> <em>buffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> & </td> + <td class="mdname" nowrap> <em>len</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>throw_exception</em> = true</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sends a message.<p> +In blocking mode: the method waits until 'len' bytes have been sent.<p> +In nonblocking mode : the method resets len to the actual number of bytes sent. Even if less bytes than expected have been sent, it returns <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw2">CSock::Ok</a>. The caller is expected to test the actual len to check if the remaining data must be resent.<p> +<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw2">CSock::Ok</a> or <a class="el" href="a02444.html#NLNET_1_1CUdpSockw3NLNET_1_1CUdpSockw1">CSock::Error</a> (in case of failure). When throw_exception is true, the method throws an <a class="el" href="a03810.html">ESocket</a> exception in case of failure. </dd></dl> + +<p> +Referenced by <a class="el" href="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05670.html#l00086">NLNET::sendEMailCommand()</a>, and <a class="el" href="a06641.html#l00107">NLNET::CUdpSimSock::sendUDPNow()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CListenSockz2083_3" doxytag="NLNET::CListenSock::setBacklog" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CListenSock::setBacklog </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>backlog</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the number of the pending connections queue, or -1 for the maximum possible value. +<p> + +<p> +Definition at line <a class="el" href="a05913.html#l00158">158</a> of file <a class="el" href="a05913.html">listen_sock.cpp</a>. +<p> +References <a class="el" href="a05914.html#l00078">_BackLog</a>, <a class="el" href="a05914.html#l00076">_Bound</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +Referenced by <a class="el" href="a05913.html#l00063">CListenSock()</a>. +<p> +<div class="fragment"><pre>00159 { +00160 <span class="keywordflow">if</span> ( backlog == -1 ) +00161 { +00162 <a class="code" href="a02769.html#NLNET_1_1CListenSockr0">_BackLog</a> = SOMAXCONN; <span class="comment">// SOMAXCONN = maximum length of the queue of pending connections</span> +00163 } +00164 <span class="keywordflow">else</span> +00165 { +00166 <a class="code" href="a02769.html#NLNET_1_1CListenSockr0">_BackLog</a> = backlog; +00167 } +00168 <span class="keywordflow">if</span> ( <a class="code" href="a02769.html#NLNET_1_1CListenSockr1">_Bound</a> ) +00169 { +00170 <span class="keywordflow">if</span> ( ::listen( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>, <a class="code" href="a02769.html#NLNET_1_1CListenSockr0">_BackLog</a> ) != 0 ) +00171 { +00172 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"Unable to listen on specified port, while changing backlog"</span> ); +00173 } +00174 } +00175 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockb1" doxytag="NLNET::CListenSock::setLocalAddress" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::setLocalAddress </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the local address. +<p> + +<p> +Referenced by <a class="el" href="a06643.html#l00074">NLNET::CUdpSock::bind()</a>, and <a class="el" href="a06643.html#l00115">NLNET::CUdpSock::sendTo()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_6" doxytag="NLNET::CListenSock::setNoDelay" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CTcpSock::setNoDelay </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>value</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets/unsets TCP_NODELAY (by default, it is off, i.e. the Nagle buffering algorithm is enabled). You must call this method *after* <a class="el" href="a02445.html#NLNET_1_1CTcpSockz2111_0">connect()</a>. +<p> +Reimplemented in <a class="el" href="a02443.html#NLNET_1_1CDummyTcpSocka7">NLNET::CDummyTcpSock</a>. +<p> +Definition at line <a class="el" href="a06487.html#l00146">146</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01132">value</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00295">NLNET::CBufSock::connect()</a>, and <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>. +<p> +<div class="fragment"><pre>00147 { +00148 <span class="keywordtype">int</span> b = <a class="code" href="a04223.html#a658">value</a>?1:0; +00149 <span class="keywordflow">if</span> ( setsockopt( _Sock, IPPROTO_TCP, TCP_NODELAY, (<span class="keywordtype">char</span>*)&b, <span class="keyword">sizeof</span>(b) ) != 0 ) +00150 { +00151 <span class="keywordflow">throw</span> ESocket( <span class="stringliteral">"setNoDelay failed"</span> ); +00152 } +00153 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2103_3" doxytag="NLNET::CListenSock::setNonBlockingMode" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::setNonBlockingMode </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>bm</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the socket in nonblocking mode. Call this method *after* <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2103_1">connect()</a>, otherwise you will get an "would block" error (10035 on Windows). In nonblocking mode, use received() and sent() instead of <a class="el" href="a02444.html#NLNET_1_1CTcpSockz2105_1">receive()</a> and <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2107_0">send()</a> +<p> +Referenced by <a class="el" href="a05515.html#l00286">NLNET::CNonBlockingBufSock::setNonBlocking()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocka3" doxytag="NLNET::CListenSock::setSendBufferSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::setSendBufferSize </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a10">sint32</a> </td> + <td class="mdname1" valign="top" nowrap> <em>size</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the send buffer size. +<p> + </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSocka4" doxytag="NLNET::CListenSock::setTimeOutValue" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CSock::setTimeOutValue </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">long </td> + <td class="mdname" nowrap> <em>sec</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>long </td> + <td class="mdname" nowrap> <em>ms</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Change the time out value used in getDataAvailable(), which is 0 by default. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00143">143</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a06405.html#l00309">NLNET::CSock::_TimeoutMs</a>, and <a class="el" href="a06405.html#l00306">NLNET::CSock::_TimeoutS</a>. +<p> +Referenced by <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>. +<p> +<div class="fragment"><pre>00144 { +00145 <a class="code" href="a02444.html#NLNET_1_1CUdpSockp9">_TimeoutS</a> = sec; +00146 <a class="code" href="a02444.html#NLNET_1_1CUdpSockp8">_TimeoutMs</a> = ms; +00147 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_7" doxytag="NLNET::CListenSock::shutdownReceiving" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CTcpSock::shutdownReceiving </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Active disconnection for download way only (partial shutdown). +<p> + +<p> +Definition at line <a class="el" href="a06487.html#l00120">120</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +<div class="fragment"><pre>00121 { +00122 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span> +00123 <span class="preprocessor"></span> ::shutdown( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>, SD_RECEIVE ); +00124 <span class="preprocessor">#elif defined NL_OS_UNIX</span> +00125 <span class="preprocessor"></span> ::shutdown( _Sock, SHUT_RD ); +00126 <span class="preprocessor">#endif</span> +00127 <span class="preprocessor"></span>} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CTcpSockz2111_8" doxytag="NLNET::CListenSock::shutdownSending" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLNET::CTcpSock::shutdownSending </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Active disconnection for upload way only (partial shutdown). +<p> + +<p> +Definition at line <a class="el" href="a06487.html#l00133">133</a> of file <a class="el" href="a06487.html">tcp_sock.cpp</a>. +<p> +<div class="fragment"><pre>00134 { +00135 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span> +00136 <span class="preprocessor"></span> ::shutdown( <a class="code" href="a02444.html#NLNET_1_1CUdpSockp7">_Sock</a>, SD_SEND ); +00137 <span class="preprocessor">#elif defined NL_OS_UNIX</span> +00138 <span class="preprocessor"></span> ::shutdown( _Sock, SHUT_WR ); +00139 <span class="preprocessor">#endif</span> +00140 <span class="preprocessor"></span>} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockz2109_4" doxytag="NLNET::CListenSock::timeOutValue" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CSock::timeOutValue </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the time out value in millisecond. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00244">244</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +References <a class="el" href="a06405.html#l00309">NLNET::CSock::_TimeoutMs</a>, <a class="el" href="a06405.html#l00306">NLNET::CSock::_TimeoutS</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00244 { <span class="keywordflow">return</span> <a class="code" href="a02444.html#NLNET_1_1CUdpSockp9">_TimeoutS</a>*1000 + <a class="code" href="a02444.html#NLNET_1_1CUdpSockp8">_TimeoutMs</a>; } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLNET_1_1CListenSockr0" doxytag="NLNET::CListenSock::_BackLog" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a02769.html#NLNET_1_1CListenSockr0">NLNET::CListenSock::_BackLog</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05914.html#l00078">78</a> of file <a class="el" href="a05914.html">listen_sock.h</a>. +<p> +Referenced by <a class="el" href="a05914.html#l00067">backlog()</a>, <a class="el" href="a05913.html#l00093">init()</a>, and <a class="el" href="a05913.html#l00158">setBacklog()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CListenSockr1" doxytag="NLNET::CListenSock::_Bound" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a02769.html#NLNET_1_1CListenSockr1">NLNET::CListenSock::_Bound</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05914.html#l00076">76</a> of file <a class="el" href="a05914.html">listen_sock.h</a>. +<p> +Referenced by <a class="el" href="a05913.html#l00093">init()</a>, and <a class="el" href="a05913.html#l00158">setBacklog()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp0" doxytag="NLNET::CListenSock::_BytesReceived" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a02444.html#NLNET_1_1CUdpSockp0">NLNET::CSock::_BytesReceived</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Number of bytes received on this socket. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00300">300</a> of file <a class="el" href="a06405.html">sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp1" doxytag="NLNET::CListenSock::_BytesSent" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a02444.html#NLNET_1_1CUdpSockp1">NLNET::CSock::_BytesSent</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Number of bytes sent on this socket. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00303">303</a> of file <a class="el" href="a06405.html">sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp2" doxytag="NLNET::CListenSock::_Connected" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> volatile bool <a class="el" href="a02444.html#NLNET_1_1CUdpSockp2">NLNET::CSock::_Connected</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +True after calling <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2103_1">connect()</a>. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00297">297</a> of file <a class="el" href="a06405.html">sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp3" doxytag="NLNET::CListenSock::_LocalAddr" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02665.html">CInetAddress</a> <a class="el" href="a02444.html#NLNET_1_1CUdpSockp3">NLNET::CSock::_LocalAddr</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Address of local host (valid if connected). +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00284">284</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +Referenced by <a class="el" href="a06405.html#l00235">NLNET::CSock::localAddr()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp4" doxytag="NLNET::CListenSock::_Logging" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a02444.html#NLNET_1_1CUdpSockp4">NLNET::CSock::_Logging</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +If false, do not log any information. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00290">290</a> of file <a class="el" href="a06405.html">sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp5" doxytag="NLNET::CListenSock::_NonBlocking" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a02444.html#NLNET_1_1CUdpSockp5">NLNET::CSock::_NonBlocking</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +If true, the socket is in nonblocking mode. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00293">293</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +Referenced by <a class="el" href="a06405.html#l00166">NLNET::CSock::nonBlockingMode()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp6" doxytag="NLNET::CListenSock::_RemoteAddr" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02665.html">CInetAddress</a> <a class="el" href="a02444.html#NLNET_1_1CUdpSockp6">NLNET::CSock::_RemoteAddr</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Address of the remote host (valid if connected). +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00287">287</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +Referenced by <a class="el" href="a06405.html#l00238">NLNET::CSock::remoteAddr()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp7" doxytag="NLNET::CListenSock::_Sock" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> SOCKET <a class="el" href="a02444.html#NLNET_1_1CUdpSockp7">NLNET::CSock::_Sock</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Socket descriptor. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00281">281</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +Referenced by <a class="el" href="a06405.html#l00241">NLNET::CSock::descriptor()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp8" doxytag="NLNET::CListenSock::_TimeoutMs" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long <a class="el" href="a02444.html#NLNET_1_1CUdpSockp8">NLNET::CSock::_TimeoutMs</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Secondary time out value (ms) for select in <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2105_0">dataAvailable()</a>. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00309">309</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +Referenced by <a class="el" href="a06405.html#l00143">NLNET::CSock::setTimeOutValue()</a>, and <a class="el" href="a06405.html#l00244">NLNET::CSock::timeOutValue()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CUdpSockp9" doxytag="NLNET::CListenSock::_TimeoutS" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> long <a class="el" href="a02444.html#NLNET_1_1CUdpSockp9">NLNET::CSock::_TimeoutS</a><code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Main time out value (sec) for select in <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2105_0">dataAvailable()</a>. +<p> + +<p> +Definition at line <a class="el" href="a06405.html#l00306">306</a> of file <a class="el" href="a06405.html">sock.h</a>. +<p> +Referenced by <a class="el" href="a06405.html#l00143">NLNET::CSock::setTimeOutValue()</a>, and <a class="el" href="a06405.html#l00244">NLNET::CSock::timeOutValue()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05914.html">listen_sock.h</a><li><a class="el" href="a05913.html">listen_sock.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:58:13 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |