diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03365.html | 1995 |
1 files changed, 1995 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03365.html b/docs/doxygen/nel/a03365.html new file mode 100644 index 00000000..26688cde --- /dev/null +++ b/docs/doxygen/nel/a03365.html @@ -0,0 +1,1995 @@ +<!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::CServerBufSock 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::CServerBufSock Class Reference</h1><code>#include <<a class="el" href="a05515.html">buf_sock.h</a>></code> +<p> +<p>Inheritance diagram for NLNET::CServerBufSock: +<p><center><img src="a03365.png" usemap="#NLNET::CServerBufSock_map" border="0" alt=""></center> +<map name="NLNET::CServerBufSock_map"> +<area href="a02991.html" alt="NLNET::CNonBlockingBufSock" shape="rect" coords="0,56,185,80"> +<area href="a02303.html" alt="NLNET::CBufSock" shape="rect" coords="0,0,185,24"> +</map> +<hr><a name="_details"></a><h2>Detailed Description</h2> +<a class="el" href="a03365.html">CServerBufSock</a> A socket, its send buffer plus a nonblocking receiving system for a server connection +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00337">337</a> of file <a class="el" href="a05515.html">buf_sock.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></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="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSocka0">appId</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the application identifier. <a href="#NLNET_1_1CServerBufSocka0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSocka1">asString</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a string with the characteristics of the object. <a href="#NLNET_1_1CServerBufSocka1"></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="a02303.html#NLNET_1_1CServerBufSocka2">setAppId</a> (<a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a04223.html#a564">id</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the application identifier. <a href="#NLNET_1_1CServerBufSocka2"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Data Fields</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSocko0">AuthorizedCallback</a></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="a02303.html#NLNET_1_1CServerBufSocko1">ReceiveNextValue</a></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="a02303.html#NLNET_1_1CServerBufSocko2">SendNextValue</a></td></tr> + +<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockb0">advertiseConnection</a> (<a class="el" href="a02302.html">CBufServer</a> *bnb)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockb1">advertiseDisconnection</a> (<a class="el" href="a02296.html">CBufNetBase</a> *bnb, <a class="el" href="a02303.html">TSockId</a> sockid)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockb2">advertiseSystemEvent</a> (<a class="el" href="a02296.html">CBufNetBase</a> *bnb, <a class="el" href="a02303.html">TSockId</a> sockid, bool &flag, bool <a class="el" href="a04223.html#a584">condition</a>, <a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7">CBufNetBase::TEventType</a> event)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockb3">connect</a> (const <a class="el" href="a02665.html">CInetAddress</a> &<a class="el" href="a04223.html#a657">addr</a>, bool nodelay, bool connectedstate)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Connects to the specified addr; set connectedstate to true if no connection advertising is needed. <a href="#NLNET_1_1CServerBufSockb3"></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="a02303.html#NLNET_1_1CServerBufSockb4">connectedState</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the "logically connected" state (changed when processing a connection/disconnection callback). <a href="#NLNET_1_1CServerBufSockb4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockb5">CServerBufSock</a> (<a class="el" href="a02445.html">CTcpSock</a> *sock)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockb6">disconnect</a> (bool connectedstate)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Disconnects; set connectedstate to false if no disconnection advertising is needed. <a href="#NLNET_1_1CServerBufSockb6"></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="a02991.html#NLNET_1_1CServerBufSockb7">fillEventTypeOnly</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill the event type byte at pos <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb9">length()</a>(for a client connection). <a href="#NLNET_1_1CServerBufSockb7"></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="a03365.html#NLNET_1_1CServerBufSockb8">fillSockIdAndEventType</a> (<a class="el" href="a02303.html">TSockId</a> sockId)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill the sockid and the event type byte at the end of the buffer. <a href="#NLNET_1_1CServerBufSockb8"></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="a02991.html#NLNET_1_1CServerBufSockb9">length</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03366.html">CServerReceiveTask</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockb10">ownerTask</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the task that "owns" the <a class="el" href="a03365.html">CServerBufSock</a> object. <a href="#NLNET_1_1CServerBufSockb10"></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="a02303.html#NLNET_1_1CServerBufSockb11">pushBuffer</a> (const <a class="el" href="a02271.html">NLMISC::CMemStream</a> &<a class="el" href="a04223.html#a589">buffer</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector< <a class="el" href="a04558.html#a7">uint8</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02991.html#NLNET_1_1CServerBufSockb12">receivedBuffer</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02991.html#NLNET_1_1CServerBufSockb13">receivePart</a> (<a class="el" href="a04558.html#a11">uint32</a> nbExtraBytes)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockb14">setConnectedState</a> (bool connectedstate)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the "logically connected" state (changed when processing a connection/disconnection callback). <a href="#NLNET_1_1CServerBufSockb14"></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="a02991.html#NLNET_1_1CServerBufSockb15">setMaxExpectedBlockSize</a> (<a class="el" href="a04558.html#a10">sint32</a> limit)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the size limit for received blocks. <a href="#NLNET_1_1CServerBufSockb15"></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="a02991.html#NLNET_1_1CServerBufSockb16">setNonBlocking</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockb17">setOwnerTask</a> (<a class="el" href="a03366.html">CServerReceiveTask</a> *owner)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the task that "owns" the <a class="el" href="a03365.html">CServerBufSock</a> object. <a href="#NLNET_1_1CServerBufSockb17"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockb18">typeStr</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns "SRV " (server). <a href="#NLNET_1_1CServerBufSockb18"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Sending data</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_0">flush</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_1">setSizeFlushTrigger</a> (<a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_2">setTimeFlushTrigger</a> (<a class="el" href="a04558.html#a10">sint32</a> ms)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_3">update</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Update the network sending (call this method evenly). Returns false if an error occured. <a href="#NLNET_1_1CServerBufSockz2081_3"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Sending data</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_0">flush</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_1">setSizeFlushTrigger</a> (<a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_2">setTimeFlushTrigger</a> (<a class="el" href="a04558.html#a10">sint32</a> ms)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_3">update</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Update the network sending (call this method evenly). Returns false if an error occured. <a href="#NLNET_1_1CServerBufSockz2081_3"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Sending data</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_0">flush</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_1">setSizeFlushTrigger</a> (<a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_2">setTimeFlushTrigger</a> (<a class="el" href="a04558.html#a10">sint32</a> ms)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockz2081_3">update</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Update the network sending (call this method evenly). Returns false if an error occured. <a href="#NLNET_1_1CServerBufSockz2081_3"></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>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockp0">_KnowConnected</a></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="a02991.html#NLNET_1_1CServerBufSockp1">_MaxExpectedBlockSize</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a04558.html#a7">uint8</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02301.html">NLMISC::CBufFIFO</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockp3">SendFifo</a></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="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a></td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockr0">_Advertised</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">True after a connection callback has been sent to the user, for this connection. <a href="#NLNET_1_1CServerBufSockr0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03366.html">CServerReceiveTask</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockr1">_OwnerTask</a></td></tr> + +<tr><td colspan=2><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02991.html#NLNET_1_1CServerBufSockn0">CBufClient</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockn1">CBufServer</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockn2">CCallbackClient</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockn3">CCallbackNetBase</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02303.html#NLNET_1_1CServerBufSockn4">CCallbackServer</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02991.html#NLNET_1_1CServerBufSockn5">CClientReceiveTask</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockn6">CListenTask</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a03365.html#NLNET_1_1CServerBufSockn7">CServerReceiveTask</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLNET_1_1CServerBufSockb5" doxytag="NLNET::CServerBufSock::CServerBufSock" ></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::CServerBufSock::CServerBufSock </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02445.html">CTcpSock</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>sock</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [protected]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor with an existing socket (created by an accept()). Don't forget to call <a class="el" href="a03365.html#NLNET_1_1CServerBufSockb17">setOwnerTask()</a>. +<p> +Definition at line <a class="el" href="a05514.html#l00370">370</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05515.html#l00040">nlnettrace</a>. +<p> +<div class="fragment"><pre>00370 : +00371 <a class="code" href="a02991.html#NLNET_1_1CNonBlockingBufSockb2">CNonBlockingBufSock</a>( sock ), +00372 <a class="code" href="a03365.html#NLNET_1_1CServerBufSockr0">_Advertised</a>( <span class="keyword">false</span> ), +00373 <a class="code" href="a03365.html#NLNET_1_1CServerBufSockr1">_OwnerTask</a>( NULL ) +00374 { +00375 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00376 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CServerBufSock::CServerBufSock"</span> ); +00377 } + +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLNET_1_1CServerBufSockb0" doxytag="NLNET::CServerBufSock::advertiseConnection" ></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::CServerBufSock::advertiseConnection </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02302.html">CBufServer</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>bnb</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, protected]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Pushes a connection message into bnb's receive queue, if it has not already been done (returns true in this case). +<p> +Definition at line <a class="el" href="a05515.html#l00359">359</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00135">NLNET::CBufSock::advertiseSystemEvent()</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>. +<p> +<div class="fragment"><pre>00360 { +00361 <span class="keywordflow">return</span> <a class="code" href="a02303.html#NLNET_1_1CServerBufSockb2">advertiseSystemEvent</a>( (CBufNetBase*)bnb, <span class="keyword">this</span>, _KnowConnected, <span class="keyword">false</span>, CBufNetBase::Connection ); +00362 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb1" doxytag="NLNET::CServerBufSock::advertiseDisconnection" ></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::CBufSock::advertiseDisconnection </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02296.html">CBufNetBase</a> * </td> + <td class="mdname" nowrap> <em>bnb</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02303.html">TSockId</a> </td> + <td class="mdname" nowrap> <em>sockid</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Pushes a disconnection message into bnb's receive queue, if it has not already been done (returns true in this case). You can either specify a sockid (for server) or InvalidSockId (for client) +<p> +Definition at line <a class="el" href="a05515.html#l00120">120</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00246">NLNET::CBufSock::_KnowConnected</a>, <a class="el" href="a05515.html#l00135">NLNET::CBufSock::advertiseSystemEvent()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>. +<p> +Referenced by <a class="el" href="a05506.html#l00121">NLNET::CBufClient::send()</a>, and <a class="el" href="a05506.html#l00296">NLNET::CBufClient::update()</a>. +<p> +<div class="fragment"><pre>00121 { +00122 <span class="preprocessor">#ifdef NL_DEBUG</span> +00123 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( sockid != InvalidSockId ) +00124 { +00125 <a class="code" href="a04199.html#a6">nlassert</a>( sockid == <span class="keyword">this</span> ); +00126 } +00127 <span class="preprocessor">#endif</span> +00128 <span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="a02303.html#NLNET_1_1CServerBufSockb2">advertiseSystemEvent</a>( bnb, sockid, _KnowConnected, <span class="keyword">true</span>, CBufNetBase::Disconnection ); +00129 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb2" doxytag="NLNET::CServerBufSock::advertiseSystemEvent" ></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::CBufSock::advertiseSystemEvent </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02296.html">CBufNetBase</a> * </td> + <td class="mdname" nowrap> <em>bnb</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02303.html">TSockId</a> </td> + <td class="mdname" nowrap> <em>sockid</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool & </td> + <td class="mdname" nowrap> <em>flag</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>condition</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7">CBufNetBase::TEventType</a> </td> + <td class="mdname" nowrap> <em>event</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Pushes a system message into bnb's receive queue, if the flags meets the condition, then resets the flag and returns true. You can either specify a sockid (for server) or InvalidSockId (for client). +<p> +Definition at line <a class="el" href="a05515.html#l00135">135</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05514.html#l00329">NLNET::CBufSock::asString()</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05646.html#l00405">condition</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05511.html#l00164">NLNET::CBufNetBase::pushMessageIntoReceiveQueue()</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00359">advertiseConnection()</a>, and <a class="el" href="a05515.html#l00120">NLNET::CBufSock::advertiseDisconnection()</a>. +<p> +<div class="fragment"><pre>00137 { +00138 <span class="preprocessor">#ifdef NL_DEBUG</span> +00139 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( sockid != InvalidSockId ) +00140 { +00141 <a class="code" href="a04199.html#a6">nlassert</a>( sockid == <span class="keyword">this</span> ); +00142 } +00143 <span class="preprocessor">#endif</span> +00144 <span class="preprocessor"></span> <span class="comment">// Test flag</span> +00145 <span class="keywordflow">if</span> ( flag==<a class="code" href="a04223.html#a584">condition</a> ) +00146 { +00147 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Pushing event to %s"</span>, <a class="code" href="a02303.html#NLNET_1_1CServerBufSocka1">asString</a>().c_str() ); +00148 std::vector<uint8> <a class="code" href="a04223.html#a589">buffer</a>; +00149 <span class="keywordflow">if</span> ( sockid == InvalidSockId ) +00150 { +00151 <span class="comment">// Client: event type only</span> +00152 <a class="code" href="a04223.html#a589">buffer</a>.resize( 1 ); +00153 <a class="code" href="a04223.html#a589">buffer</a>[0] = event; +00154 } +00155 <span class="keywordflow">else</span> +00156 { +00157 <span class="comment">// Server: sockid + event type</span> +00158 <a class="code" href="a04223.html#a589">buffer</a>.resize( <span class="keyword">sizeof</span>(TSockId) + 1 ); +00159 memcpy( &*<a class="code" href="a04223.html#a589">buffer</a>.begin(), &sockid, <span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a74">TSockId</a>) ); +00160 <a class="code" href="a04223.html#a589">buffer</a>[<span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a74">TSockId</a>)] = event; +00161 } +00162 <span class="comment">// Push</span> +00163 bnb->pushMessageIntoReceiveQueue( buffer ); +00164 +00165 <span class="comment">// Reset flag</span> +00166 flag = !<a class="code" href="a04223.html#a584">condition</a>; +00167 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00168 } +00169 <span class="keywordflow">else</span> +00170 { +00171 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00172 } +00173 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSocka0" doxytag="NLNET::CServerBufSock::appId" ></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::CBufSock::appId </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 application identifier. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00063">63</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00262">NLNET::CBufSock::_AppId</a>, and <a class="el" href="a05981.html#l00102">uint64</a>. +<p> +Referenced by <a class="el" href="a06646.html#l00275">NLNET::CUnifiedNetwork::CUnifiedConnection::TConnection::getAppId()</a>. +<p> +<div class="fragment"><pre>00063 { <span class="keywordflow">return</span> _AppId; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSocka1" doxytag="NLNET::CServerBufSock::asString" ></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"> string NLNET::CBufSock::asString </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> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns a string with the characteristics of the object. +<p> + +<p> +Definition at line <a class="el" href="a05514.html#l00329">329</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a06405.html#l00241">NLNET::CSock::descriptor()</a>, <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>, <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>, <a class="el" href="a06465.html#l00169">NLMISC::toStringPtr()</a>, and <a class="el" href="a05515.html#l00115">NLNET::CBufSock::typeStr()</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00135">NLNET::CBufSock::advertiseSystemEvent()</a>, <a class="el" href="a05526.html#l00471">NLNET::CCallbackNetBase::authorizeOnly()</a>, <a class="el" href="a05512.html#l00364">NLNET::CBufServer::dataAvailable()</a>, <a class="el" href="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05526.html#l00223">NLNET::CCallbackNetBase::processOneMessage()</a>, <a class="el" href="a05514.html#l00386">NLNET::CNonBlockingBufSock::receivePart()</a>, <a class="el" href="a05512.html#l00987">NLNET::CServerReceiveTask::run()</a>, <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>, <a class="el" href="a06098.html#l00455">NLNET::CNetManager::send()</a>, and <a class="el" href="a05528.html#l00091">NLNET::CCallbackServer::sendAllMyAssociations()</a>. +<p> +<div class="fragment"><pre>00330 { +00331 <span class="comment">// stringstream ss;</span> +00332 string str; +00333 <span class="keywordflow">if</span> (<span class="keyword">this</span> == InvalidSockId) <span class="comment">// tricky</span> +00334 str = <span class="stringliteral">"<null>"</span>; +00335 <span class="keywordflow">else</span> +00336 { +00337 <span class="comment">// if it crashs here, it means that the CBufSock was deleted and you try to access to the virtual table that is empty</span> +00338 <span class="comment">// because the object is destroyed.</span> +00339 str += <a class="code" href="a03365.html#NLNET_1_1CServerBufSockb18">typeStr</a>(); +00340 str += <a class="code" href="a05378.html#a408">NLMISC::toStringPtr</a>(<span class="keyword">this</span>) + <span class="stringliteral">" (socket "</span>; +00341 +00342 <span class="keywordflow">if</span> (<a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a> == NULL) +00343 str += <span class="stringliteral">"<null>"</span>; +00344 <span class="keywordflow">else</span> +00345 str += <a class="code" href="a05378.html#a244">NLMISC::toString</a>(<a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->descriptor()); +00346 +00347 str += <span class="stringliteral">")"</span>; +00348 } +00349 <span class="keywordflow">return</span> str; +00350 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb3" doxytag="NLNET::CServerBufSock::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::CBufSock::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="mdname" nowrap> <em>addr</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>nodelay</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>connectedstate</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> +Connects to the specified addr; set connectedstate to true if no connection advertising is needed. +<p> + +<p> +Definition at line <a class="el" href="a05514.html#l00295">295</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05515.html#l00265">NLNET::CBufSock::_ConnectedState</a>, <a class="el" href="a05515.html#l00246">NLNET::CBufSock::_KnowConnected</a>, <a class="el" href="a05646.html#l01127">addr</a>, <a class="el" href="a06487.html#l00080">NLNET::CTcpSock::connect()</a>, <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2109_0">NLNET::CSock::connected()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05515.html#l00074">NLNET::CBufSock::ReceiveNextValue</a>, <a class="el" href="a05515.html#l00074">NLNET::CBufSock::SendNextValue</a>, <a class="el" href="a06487.html#l00146">NLNET::CTcpSock::setNoDelay()</a>, and <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>. +<p> +Referenced by <a class="el" href="a05524.html#l00286">NLNET::CCallbackClient::connect()</a>, and <a class="el" href="a05506.html#l00085">NLNET::CBufClient::connect()</a>. +<p> +<div class="fragment"><pre>00296 { +00297 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00298 <a class="code" href="a04199.html#a6">nlassert</a>( ! <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->connected() ); +00299 +00300 <a class="code" href="a02303.html#NLNET_1_1CServerBufSocko2">SendNextValue</a> = <a class="code" href="a02303.html#NLNET_1_1CServerBufSocko1">ReceiveNextValue</a> = 0; +00301 +00302 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->connect( addr ); +00303 _ConnectedState = connectedstate; +00304 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp0">_KnowConnected</a> = connectedstate; +00305 <span class="keywordflow">if</span> ( nodelay ) +00306 { +00307 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->setNoDelay( <span class="keyword">true</span> ); +00308 } +00309 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb4" doxytag="NLNET::CServerBufSock::connectedState" ></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::CBufSock::connectedState </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, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the "logically connected" state (changed when processing a connection/disconnection callback). +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00237">237</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00265">NLNET::CBufSock::_ConnectedState</a>. +<p> +Referenced by <a class="el" href="a05507.html#l00166">NLNET::CBufClient::connected()</a>, <a class="el" href="a05524.html#l00354">NLNET::CCallbackClient::disconnect()</a>, <a class="el" href="a05506.html#l00318">NLNET::CBufClient::disconnect()</a>, and <a class="el" href="a05506.html#l00397">NLNET::CBufClient::~CBufClient()</a>. +<p> +<div class="fragment"><pre>00237 { <span class="keywordflow">return</span> _ConnectedState; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb6" doxytag="NLNET::CServerBufSock::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::CBufSock::disconnect </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>connectedstate</em> </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> +Disconnects; set connectedstate to false if no disconnection advertising is needed. +<p> + +<p> +Definition at line <a class="el" href="a05514.html#l00315">315</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05515.html#l00265">NLNET::CBufSock::_ConnectedState</a>, <a class="el" href="a05515.html#l00246">NLNET::CBufSock::_KnowConnected</a>, <a class="el" href="a06487.html#l00101">NLNET::CTcpSock::disconnect()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05515.html#l00074">NLNET::CBufSock::ReceiveNextValue</a>, <a class="el" href="a05515.html#l00074">NLNET::CBufSock::SendNextValue</a>, and <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>. +<p> +Referenced by <a class="el" href="a05506.html#l00318">NLNET::CBufClient::disconnect()</a>. +<p> +<div class="fragment"><pre>00316 { +00317 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00318 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->disconnect(); +00319 _ConnectedState = connectedstate; +00320 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp0">_KnowConnected</a> = connectedstate; +00321 +00322 <a class="code" href="a02303.html#NLNET_1_1CServerBufSocko2">SendNextValue</a> = <a class="code" href="a02303.html#NLNET_1_1CServerBufSocko1">ReceiveNextValue</a> = 0; +00323 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb7" doxytag="NLNET::CServerBufSock::fillEventTypeOnly" ></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::CNonBlockingBufSock::fillEventTypeOnly </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, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Fill the event type byte at pos <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb9">length()</a>(for a client connection). +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00298">298</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00311">NLNET::CNonBlockingBufSock::_ReceiveBuffer</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>. +<p> +<div class="fragment"><pre>00298 { <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>[_Length] = (<a class="code" href="a04558.html#a7">uint8</a>)CBufNetBase::User; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb8" doxytag="NLNET::CServerBufSock::fillSockIdAndEventType" ></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::CServerBufSock::fillSockIdAndEventType </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td> + <td class="mdname1" valign="top" nowrap> <em>sockId</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, protected]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Fill the sockid and the event type byte at the end of the buffer. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00368">368</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00303">NLNET::CNonBlockingBufSock::length()</a>, <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00987">NLNET::CServerReceiveTask::run()</a>. +<p> +<div class="fragment"><pre>00369 { +00370 memcpy( (&*<a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>.begin()) + <a class="code" href="a02991.html#NLNET_1_1CServerBufSockb9">length</a>(), &sockId, <span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a74">TSockId</a>) ); +00371 <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>[<a class="code" href="a02991.html#NLNET_1_1CServerBufSockb9">length</a>() + <span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a74">TSockId</a>)] = (<a class="code" href="a04558.html#a7">uint8</a>)CBufNetBase::User; +00372 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockz2081_0" doxytag="NLNET::CServerBufSock::flush" ></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::CBufSock::flush </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> +Forces to send all data pending in the send queue <dl compact><dt><b>Returns:</b></dt><dd>False if an error has occured (e.g. the remote host is disconnected). To retrieve the reason of the error, call <a class="el" href="a02444.html#NLNET_1_1CUdpSocke1">CSock::getLastError()</a> and/or <a class="el" href="a02444.html#NLNET_1_1CUdpSocke0">CSock::errorString()</a></dd></dl> + +<p> +Definition at line <a class="el" href="a05514.html#l00137">137</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05515.html#l00259">NLNET::CBufSock::_ReadyToSendBuffer</a>, <a class="el" href="a05515.html#l00260">NLNET::CBufSock::_RTSBIndex</a>, <a class="el" href="a05514.html#l00329">NLNET::CBufSock::asString()</a>, <a class="el" href="a06116.html#l00124">NLMISC::CObjectVector< uint8 >::clear()</a>, <a class="el" href="a05509.html#l00100">NLMISC::CBufFIFO::empty()</a>, <a class="el" href="a05508.html#l00237">NLMISC::CBufFIFO::front()</a>, <a class="el" href="a06116.html#l00195">NLMISC::CObjectVector< uint8 >::getPtr()</a>, <a class="el" href="a05646.html#l00235">len</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00333">nlassertex</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05508.html#l00168">NLMISC::CBufFIFO::pop()</a>, <a class="el" href="a05646.html#l01119">res</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector< uint8 >::resize()</a>, <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2107_0">NLNET::CSock::send()</a>, <a class="el" href="a05515.html#l00240">NLNET::CBufSock::SendFifo</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector< uint8 >::size()</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>, <a class="el" href="a05511.html#l00059">NLNET::TBlockSize</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <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="a05513.html#l00232">NLNET::CBufServer::flush()</a>, <a class="el" href="a05507.html#l00158">NLNET::CBufClient::flush()</a>, and <a class="el" href="a05514.html#l00247">NLNET::CBufSock::update()</a>. +<p> +<div class="fragment"><pre>00138 { +00139 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00140 <span class="comment">//nlnettrace( "CBufSock::flush" );</span> +00141 +00142 <span class="comment">// Copy data from the send queue to _ReadyToSendBuffer</span> +00143 <a class="code" href="a05379.html#a80">TBlockSize</a> netlen; +00144 <span class="comment">// vector<uint8> tmpbuffer;</span> +00145 +00146 <span class="comment">// Process each element in the send queue</span> +00147 <span class="keywordflow">while</span> ( ! <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp3">SendFifo</a>.<a class="code" href="a02301.html#NLMISC_1_1CBufFIFOa4">empty</a>() ) +00148 { +00149 <a class="code" href="a04558.html#a7">uint8</a> *tmpbuffer; +00150 <a class="code" href="a04558.html#a11">uint32</a> <a class="code" href="a04223.html#a587">size</a>; +00151 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp3">SendFifo</a>.<a class="code" href="a02301.html#NLMISC_1_1CBufFIFOa7">front</a>( tmpbuffer, size ); +00152 +00153 <span class="comment">// Compute the size and add it into the beginning of the buffer</span> +00154 netlen = htonl( (TBlockSize)size ); +00155 <a class="code" href="a04558.html#a11">uint32</a> oldBufferSize = _ReadyToSendBuffer.size(); +00156 _ReadyToSendBuffer.resize (oldBufferSize+<span class="keyword">sizeof</span>(TBlockSize)+size); +00157 *(<a class="code" href="a05379.html#a80">TBlockSize</a>*)&(_ReadyToSendBuffer[oldBufferSize])=netlen; +00158 <span class="comment">//nldebug( "O-%u %u+L%u (0x%x)", Sock->descriptor(), oldBufferSize, size, size );</span> +00159 +00160 +00161 <span class="comment">// Append the temporary buffer to the global buffer</span> +00162 CFastMem::memcpy (&_ReadyToSendBuffer[oldBufferSize+<span class="keyword">sizeof</span>(TBlockSize)], tmpbuffer, size); +00163 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp3">SendFifo</a>.<a class="code" href="a02301.html#NLMISC_1_1CBufFIFOa9">pop</a>(); +00164 } +00165 +00166 <span class="comment">// Actual sending of _ReadyToSendBuffer</span> +00167 <span class="comment">//if ( ! _ReadyToSendBuffer.empty() )</span> +00168 <span class="keywordflow">if</span> ( _ReadyToSendBuffer.size() != 0 ) +00169 { +00170 <span class="comment">// Send</span> +00171 CSock::TSockResult <a class="code" href="a04223.html#a643">res</a>; +00172 <a class="code" href="a05379.html#a80">TBlockSize</a> <a class="code" href="a04223.html#a571">len</a> = _ReadyToSendBuffer.size() - _RTSBIndex; +00173 +00174 <a class="code" href="a04223.html#a643">res</a> = <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->send( _ReadyToSendBuffer.getPtr()+_RTSBIndex, <a class="code" href="a04223.html#a571">len</a>, <span class="keyword">false</span> ); +00175 +00176 <span class="keywordflow">if</span> ( <a class="code" href="a04223.html#a643">res</a> == CSock::Ok ) +00177 { +00178 <span class="comment">/* // Debug display</span> +00179 <span class="comment"> switch ( _FlushTrigger )</span> +00180 <span class="comment"> {</span> +00181 <span class="comment"> case FTTime : nldebug( "LNETL1: Time triggered flush for %s:", asString().c_str() ); break;</span> +00182 <span class="comment"> case FTSize : nldebug( "LNETL1: Size triggered flush for %s:", asString().c_str() ); break;</span> +00183 <span class="comment"> default: nldebug( "LNETL1: Manual flush for %s:", asString().c_str() );</span> +00184 <span class="comment"> }</span> +00185 <span class="comment"> _FlushTrigger = FTManual;</span> +00186 <span class="comment"> nldebug( "LNETL1: %s sent effectively a buffer (%d on %d B)", asString().c_str(), len, _ReadyToSendBuffer.size() );</span> +00187 <span class="comment">*/</span> +00188 +00189 <span class="comment">// TODO OPTIM remove the nldebug for speed</span> +00190 <span class="comment">//commented for optimisation nldebug( "LNETL1: %s sent effectively %u/%u bytes (pos %u wantedsend %u)", asString().c_str(), len, _ReadyToSendBuffer.size(), _RTSBIndex, realLen/*, stringFromVectorPart(_ReadyToSendBuffer,_RTSBIndex,len).c_str()*/ );</span> +00191 +00192 <span class="keywordflow">if</span> ( _RTSBIndex+<a class="code" href="a04223.html#a571">len</a> == _ReadyToSendBuffer.size() ) <span class="comment">// for non-blocking mode</span> +00193 { +00194 <span class="comment">// If sending is ok, clear the global buffer</span> +00195 <span class="comment">//nldebug( "O-%u all %u bytes (%u to %u) sent", Sock->descriptor(), len, _RTSBIndex, _ReadyToSendBuffer.size() );</span> +00196 _ReadyToSendBuffer.clear(); +00197 _RTSBIndex = 0; +00198 } +00199 <span class="keywordflow">else</span> +00200 { +00201 <span class="comment">// Or clear only the data that was actually sent</span> +00202 <a class="code" href="a04199.html#a8">nlassertex</a>( _RTSBIndex+len < _ReadyToSendBuffer.size(), (<span class="stringliteral">"index=%u len=%u size=%u"</span>, _RTSBIndex, <a class="code" href="a04223.html#a571">len</a>, _ReadyToSendBuffer.size()) ); +00203 <span class="comment">//nldebug( "O-%u only %u B on %u (%u to %u) sent", Sock->descriptor(), len, _ReadyToSendBuffer.size()-_RTSBIndex, _RTSBIndex, _ReadyToSendBuffer.size() );</span> +00204 _RTSBIndex += <a class="code" href="a04223.html#a571">len</a>; +00205 <span class="keywordflow">if</span> ( _ReadyToSendBuffer.size() > 20480 ) <span class="comment">// if big, clear data already sent</span> +00206 { +00207 <a class="code" href="a04558.html#a15">uint</a> nbcpy = _ReadyToSendBuffer.size() - _RTSBIndex; +00208 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i = 0; i < nbcpy; i++) +00209 { +00210 _ReadyToSendBuffer[i] = _ReadyToSendBuffer[i+_RTSBIndex]; +00211 } +00212 _ReadyToSendBuffer.resize(nbcpy); +00213 <span class="comment">//_ReadyToSendBuffer.erase( _ReadyToSendBuffer.begin(), _ReadyToSendBuffer.begin()+_RTSBIndex );</span> +00214 _RTSBIndex = 0; +00215 <span class="comment">//nldebug( "O-%u Cleared data already sent, %u B remain", Sock->descriptor(), nbcpy );</span> +00216 } +00217 } +00218 } +00219 <span class="keywordflow">else</span> +00220 { +00221 <span class="preprocessor">#ifdef NL_DEBUG</span> +00222 <span class="preprocessor"></span> <span class="comment">// can happen in a normal behavior if, for example, the other side is not connected anymore</span> +00223 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: %s failed to send effectively a buffer of %d bytes"</span>, <a class="code" href="a02303.html#NLNET_1_1CServerBufSocka1">asString</a>().c_str(), _ReadyToSendBuffer.size() ); +00224 <span class="preprocessor">#endif</span> +00225 <span class="preprocessor"></span> <span class="keywordflow">return</span> <span class="keyword">false</span>; +00226 } +00227 } +00228 +00229 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00230 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb9" doxytag="NLNET::CServerBufSock::length" ></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::CNonBlockingBufSock::length </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, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return the length of the received block (call after <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb13">receivePart()</a> returns true). The total size of received buffer is <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb9">length()</a> + nbExtraBytes (passed to <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb13">receivePart()</a>). +<p> +Definition at line <a class="el" href="a05515.html#l00303">303</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00368">fillSockIdAndEventType()</a>. +<p> +<div class="fragment"><pre>00303 { <span class="keywordflow">return</span> _Length; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb10" doxytag="NLNET::CServerBufSock::ownerTask" ></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="a03366.html">CServerReceiveTask</a>* NLNET::CServerBufSock::ownerTask </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, protected]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the task that "owns" the <a class="el" href="a03365.html">CServerBufSock</a> object. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00354">354</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00380">_OwnerTask</a>. +<p> +<div class="fragment"><pre>00354 { <span class="keywordflow">return</span> <a class="code" href="a03365.html#NLNET_1_1CServerBufSockr1">_OwnerTask</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb11" doxytag="NLNET::CServerBufSock::pushBuffer" ></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::CBufSock::pushBuffer </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02271.html">NLMISC::CMemStream</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>buffer</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Pushes a buffer to the send queue and update, or returns false if the socket is not physically connected the or an error occured during sending +<p> +Definition at line <a class="el" href="a05515.html#l00178">178</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2109_0">NLNET::CSock::connected()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05509.html#l00072">NLMISC::CBufFIFO::push()</a>, <a class="el" href="a05646.html#l01119">res</a>, <a class="el" href="a05515.html#l00240">NLNET::CBufSock::SendFifo</a>, <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05514.html#l00247">NLNET::CBufSock::update()</a>. +<p> +Referenced by <a class="el" href="a05513.html#l00298">NLNET::CBufServer::pushBufferToHost()</a>, and <a class="el" href="a05506.html#l00121">NLNET::CBufClient::send()</a>. +<p> +<div class="fragment"><pre>00179 { +00180 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00181 <span class="comment">// nldebug( "LNETL1: Pushing buffer to %s", asString().c_str() );</span> +00182 +00183 <span class="keyword">static</span> <a class="code" href="a04558.html#a11">uint32</a> biggerBufferSize = 64000; +00184 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a589">buffer</a>.length() > biggerBufferSize) +00185 { +00186 biggerBufferSize = <a class="code" href="a04223.html#a589">buffer</a>.length(); +00187 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"LNETL1: new record! bigger network message pushed (sent) is %u bytes"</span>, biggerBufferSize); +00188 } +00189 +00190 <span class="keywordflow">if</span> ( <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->connected() ) +00191 { +00192 <span class="comment">// Push into host's send queue</span> +00193 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp3">SendFifo</a>.<a class="code" href="a02301.html#NLMISC_1_1CBufFIFOa13">push</a>( buffer ); +00194 +00195 <span class="comment">// Update sending</span> +00196 <span class="keywordtype">bool</span> <a class="code" href="a04223.html#a643">res</a> = <a class="code" href="a02303.html#NLNET_1_1CServerBufSockz2081_3">update</a> (); +00197 <span class="keywordflow">return</span> <a class="code" href="a04223.html#a643">res</a>; <span class="comment">// not checking the result as in CBufServer::update()</span> +00198 } +00199 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00200 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb12" doxytag="NLNET::CServerBufSock::receivedBuffer" ></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 std::vector<<a class="el" href="a04558.html#a7">uint8</a>> NLNET::CNonBlockingBufSock::receivedBuffer </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, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the filled buffer (call after <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb13">receivePart()</a> returns true). Its size is <a class="el" href="a02991.html#NLNET_1_1CServerBufSockb9">length()</a>+1. +<p> +Definition at line <a class="el" href="a05515.html#l00308">308</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00311">NLNET::CNonBlockingBufSock::_ReceiveBuffer</a>, and <a class="el" href="a05515.html#l00040">nlnettrace</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00987">NLNET::CServerReceiveTask::run()</a>, and <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>. +<p> +<div class="fragment"><pre>00308 { <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CServerBufSock::receivedBuffer"</span> ); <span class="keywordflow">return</span> <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb13" doxytag="NLNET::CServerBufSock::receivePart" ></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::CNonBlockingBufSock::receivePart </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a11">uint32</a> </td> + <td class="mdname1" valign="top" nowrap> <em>nbExtraBytes</em> </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> +Receives a part of a message (nonblocking socket only) <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>nbExtraBytes</em> </td><td>Number of bytes to reserve for extra information such as the event type </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>True if the message has been completely received</dd></dl> + +<p> +Definition at line <a class="el" href="a05514.html#l00386">386</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05515.html#l00322">NLNET::CNonBlockingBufSock::_BytesRead</a>, <a class="el" href="a05515.html#l00319">NLNET::CNonBlockingBufSock::_NowReadingBuffer</a>, <a class="el" href="a05515.html#l00311">NLNET::CNonBlockingBufSock::_ReceiveBuffer</a>, <a class="el" href="a05810.html#l00385">NLNET::CInetAddress::asString()</a>, <a class="el" href="a05514.html#l00329">NLNET::CBufSock::asString()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a02444.html#NLNET_1_1CTcpSockz2105_1">NLNET::CSock::receive()</a>, <a class="el" href="a06405.html#l00238">NLNET::CSock::remoteAddr()</a>, <a class="el" href="a05586.html#l00107">NLMISC::stringFromVector()</a>, <a class="el" href="a05511.html#l00059">NLNET::TBlockSize</a>, <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00987">NLNET::CServerReceiveTask::run()</a>, and <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>. +<p> +<div class="fragment"><pre>00387 { +00388 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00389 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CNonBlockingBufSock::receivePart"</span> ); +00390 +00391 <a class="code" href="a05379.html#a80">TBlockSize</a> actuallen; +00392 <span class="keywordflow">if</span> ( ! _NowReadingBuffer ) +00393 { +00394 <span class="comment">// Receiving length prefix</span> +00395 actuallen = <span class="keyword">sizeof</span>(_Length)-_BytesRead; +00396 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->receive( (<a class="code" href="a04558.html#a7">uint8</a>*)(&_Length)+_BytesRead, actuallen ); +00397 _BytesRead += actuallen; +00398 <span class="keywordflow">if</span> ( _BytesRead == <span class="keyword">sizeof</span>(_Length ) ) +00399 { +00400 <span class="keywordflow">if</span> ( _Length != 0 ) +00401 { +00402 _Length = ntohl( _Length ); +00403 <span class="comment">//nldebug( "I-%u L%u (0x%x) a%u", Sock->descriptor(), _Length, _Length, actuallen );</span> +00404 +00405 <span class="comment">// Test size limit</span> +00406 <span class="keywordflow">if</span> ( _Length > <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp1">_MaxExpectedBlockSize</a> ) +00407 { +00408 <a class="code" href="a04199.html#a2">nlwarning</a>( <span class="stringliteral">"LNETL1: Socket %s received header length %u exceeding max expected %u... Disconnecting"</span>, <a class="code" href="a02303.html#NLNET_1_1CServerBufSocka1">asString</a>().c_str(), _Length, _MaxExpectedBlockSize ); +00409 <span class="keywordflow">throw</span> ESocket( <a class="code" href="a05378.html#a244">toString</a>( <span class="stringliteral">"Received length %u exceeding max expected %u from %s"</span>, _Length, _MaxExpectedBlockSize, <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->remoteAddr().asString().c_str() ).c_str(), <span class="keyword">false</span> ); +00410 } +00411 +00412 _NowReadingBuffer = <span class="keyword">true</span>; +00413 <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>.resize( _Length + nbExtraBytes ); +00414 } +00415 <span class="keywordflow">else</span> +00416 { +00417 <a class="code" href="a04199.html#a2">nlwarning</a>( <span class="stringliteral">"LNETL1: Socket %s received null length in block header"</span>, <a class="code" href="a02303.html#NLNET_1_1CServerBufSocka1">asString</a>().c_str() ); +00418 } +00419 _BytesRead = 0; +00420 } +00421 } +00422 +00423 <span class="keywordflow">if</span> ( _NowReadingBuffer ) +00424 { +00425 <span class="comment">// Receiving payload buffer</span> +00426 actuallen = _Length-_BytesRead; +00427 <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->receive( &*<a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>.begin()+_BytesRead, actuallen ); +00428 _BytesRead += actuallen; +00429 +00430 <span class="keywordflow">if</span> ( _BytesRead == _Length ) +00431 { +00432 <span class="preprocessor">#ifdef NL_DEBUG</span> +00433 <span class="preprocessor"></span> <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: %s received buffer (%u bytes): [%s]"</span>, <a class="code" href="a02303.html#NLNET_1_1CServerBufSocka1">asString</a>().c_str(), <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp2">_ReceiveBuffer</a>.size(), <a class="code" href="a05378.html#a258">stringFromVector</a>(_ReceiveBuffer).c_str() ); +00434 <span class="preprocessor">#endif</span> +00435 <span class="preprocessor"></span> _NowReadingBuffer = <span class="keyword">false</span>; +00436 <span class="comment">//nldebug( "I-%u all %u B on %u", Sock->descriptor(), actuallen );</span> +00437 _BytesRead = 0; +00438 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00439 } +00440 <span class="comment">//else</span> +00441 <span class="comment">//{</span> +00442 <span class="comment">// nldebug( "I-%u only %u B on %u", actuallen, Sock->descriptor(), _Length-(_BytesRead-actuallen) );</span> +00443 <span class="comment">//}</span> +00444 } +00445 +00446 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00447 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSocka2" doxytag="NLNET::CServerBufSock::setAppId" ></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::CBufSock::setAppId </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a13">uint64</a> </td> + <td class="mdname1" valign="top" nowrap> <em>id</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the application identifier. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00060">60</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00262">NLNET::CBufSock::_AppId</a>, and <a class="el" href="a05981.html#l00102">uint64</a>. +<p> +Referenced by <a class="el" href="a06645.html#l00653">NLNET::CUnifiedNetwork::addService()</a>, <a class="el" href="a06138.html#l00577">NLNET::CPacsClient::connect()</a>, and <a class="el" href="a06646.html#l00274">NLNET::CUnifiedNetwork::CUnifiedConnection::TConnection::setAppId()</a>. +<p> +<div class="fragment"><pre>00060 { _AppId = <span class="keywordtype">id</span>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb14" doxytag="NLNET::CServerBufSock::setConnectedState" ></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::CBufSock::setConnectedState </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>connectedstate</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the "logically connected" state (changed when processing a connection/disconnection callback). +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00234">234</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00265">NLNET::CBufSock::_ConnectedState</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00364">NLNET::CBufServer::dataAvailable()</a>, and <a class="el" href="a05506.html#l00140">NLNET::CBufClient::dataAvailable()</a>. +<p> +<div class="fragment"><pre>00234 { _ConnectedState = connectedstate; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb15" doxytag="NLNET::CServerBufSock::setMaxExpectedBlockSize" ></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::CNonBlockingBufSock::setMaxExpectedBlockSize </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>limit</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Set the size limit for received blocks. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00289">289</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05981.html#l00099">sint32</a>. +<p> +Referenced by <a class="el" href="a05506.html#l00085">NLNET::CBufClient::connect()</a>, and <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>. +<p> +<div class="fragment"><pre>00289 { <a class="code" href="a02991.html#NLNET_1_1CServerBufSockp1">_MaxExpectedBlockSize</a> = limit; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb16" doxytag="NLNET::CServerBufSock::setNonBlocking" ></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::CNonBlockingBufSock::setNonBlocking </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, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Call this method after connecting (for a client connection) to set the non-blocking mode. For a server connection, call it as soon as the object is constructed +<p> +Definition at line <a class="el" href="a05515.html#l00286">286</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2103_3">NLNET::CSock::setNonBlockingMode()</a>. +<p> +Referenced by <a class="el" href="a05506.html#l00085">NLNET::CBufClient::connect()</a>, and <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>. +<p> +<div class="fragment"><pre>00286 { <a class="code" href="a02303.html#NLNET_1_1CServerBufSockp4">Sock</a>->setNonBlockingMode( <span class="keyword">true</span> ); } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb17" doxytag="NLNET::CServerBufSock::setOwnerTask" ></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::CServerBufSock::setOwnerTask </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03366.html">CServerReceiveTask</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>owner</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, protected]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the task that "owns" the <a class="el" href="a03365.html">CServerBufSock</a> object. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00351">351</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00380">_OwnerTask</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00958">NLNET::CBufServer::addNewThread()</a>, and <a class="el" href="a05512.html#l00866">NLNET::CBufServer::dispatchNewSocket()</a>. +<p> +<div class="fragment"><pre>00351 { <a class="code" href="a03365.html#NLNET_1_1CServerBufSockr1">_OwnerTask</a> = owner; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockz2081_1" doxytag="NLNET::CServerBufSock::setSizeFlushTrigger" ></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::CBufSock::setSizeFlushTrigger </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> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sets the size flush trigger. When the size of the send queue reaches or exceeds this calue, all data in the send queue is automatically sent (-1 to disable this trigger ) +<p> +Definition at line <a class="el" href="a05515.html#l00104">104</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +References <a class="el" href="a05515.html#l00257">NLNET::CBufSock::_TriggerSize</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05646.html#l00645">size</a>. +<p> +Referenced by <a class="el" href="a05513.html#l00226">NLNET::CBufServer::setSizeFlushTrigger()</a>, and <a class="el" href="a05507.html#l00152">NLNET::CBufClient::setSizeFlushTrigger()</a>. +<p> +<div class="fragment"><pre>00104 { _TriggerSize = <a class="code" href="a04223.html#a587">size</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockz2081_2" doxytag="NLNET::CServerBufSock::setTimeFlushTrigger" ></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::CBufSock::setTimeFlushTrigger </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>ms</em> </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 time flush trigger (in millisecond). When this time is elapsed, all data in the send queue is automatically sent (-1 to disable this trigger) +<p> +Definition at line <a class="el" href="a05514.html#l00236">236</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05515.html#l00255">NLNET::CBufSock::_LastFlushTime</a>, <a class="el" href="a05515.html#l00256">NLNET::CBufSock::_TriggerTime</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00099">sint32</a>. +<p> +Referenced by <a class="el" href="a05513.html#l00221">NLNET::CBufServer::setTimeFlushTrigger()</a>, and <a class="el" href="a05507.html#l00147">NLNET::CBufClient::setTimeFlushTrigger()</a>. +<p> +<div class="fragment"><pre>00237 { +00238 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00239 _TriggerTime = ms; +00240 _LastFlushTime = CTime::getLocalTime(); +00241 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockb18" doxytag="NLNET::CServerBufSock::typeStr" ></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 std::string NLNET::CServerBufSock::typeStr </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, protected, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns "SRV " (server). +<p> + +<p> +Reimplemented from <a class="el" href="a02303.html#NLNET_1_1CNonBlockingBufSockb14">NLNET::CBufSock</a>. +<p> +Definition at line <a class="el" href="a05515.html#l00365">365</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +<div class="fragment"><pre>00365 { <span class="keywordflow">return</span> <span class="stringliteral">"SRV "</span>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockz2081_3" doxytag="NLNET::CServerBufSock::update" ></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::CBufSock::update </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> +Update the network sending (call this method evenly). Returns false if an error occured. +<p> + +<p> +Definition at line <a class="el" href="a05514.html#l00247">247</a> of file <a class="el" href="a05514.html">buf_sock.cpp</a>. +<p> +References <a class="el" href="a05515.html#l00255">NLNET::CBufSock::_LastFlushTime</a>, <a class="el" href="a05515.html#l00257">NLNET::CBufSock::_TriggerSize</a>, <a class="el" href="a05515.html#l00256">NLNET::CBufSock::_TriggerTime</a>, <a class="el" href="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05515.html#l00240">NLNET::CBufSock::SendFifo</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a05508.html#l00410">NLMISC::CBufFIFO::size()</a>, and <a class="el" href="a06553.html#l00047">NLMISC::TTime</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00178">NLNET::CBufSock::pushBuffer()</a>, and <a class="el" href="a05506.html#l00296">NLNET::CBufClient::update()</a>. +<p> +<div class="fragment"><pre>00248 { +00249 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keyword">this</span> != InvalidSockId); <span class="comment">// invalid bufsock</span> +00250 <span class="comment">// nlnettrace( "CBufSock::update-BEGIN" );</span> +00251 <span class="comment">// Time trigger</span> +00252 +00253 <span class="keywordflow">if</span> ( _TriggerTime != -1 ) +00254 { +00255 <a class="code" href="a05378.html#a242">TTime</a> now = CTime::getLocalTime(); +00256 <span class="keywordflow">if</span> ( (<a class="code" href="a04558.html#a10">sint32</a>)(now-_LastFlushTime) >= _TriggerTime ) +00257 { +00258 <span class="preprocessor">#ifdef NL_DEBUG</span> +00259 <span class="preprocessor"></span> _FlushTrigger = FTTime; +00260 <span class="preprocessor">#endif</span> +00261 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( <a class="code" href="a02303.html#NLNET_1_1CServerBufSockz2081_0">flush</a>() ) +00262 { +00263 _LastFlushTime = now; +00264 <span class="comment">// nlnettrace ( "CBufSock::update-END time 1" );</span> +00265 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00266 } +00267 <span class="keywordflow">else</span> +00268 { +00269 <span class="comment">// nlnettrace ( "CBufSock::update-END time 0" );</span> +00270 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00271 } +00272 } +00273 } +00274 <span class="comment">// Size trigger</span> +00275 <span class="keywordflow">if</span> ( _TriggerSize != -1 ) +00276 { +00277 <span class="keywordflow">if</span> ( (<a class="code" href="a04558.html#a10">sint32</a>)<a class="code" href="a02303.html#NLNET_1_1CServerBufSockp3">SendFifo</a>.<a class="code" href="a02301.html#NLMISC_1_1CBufFIFOa15">size</a>() > _TriggerSize ) +00278 { +00279 <span class="preprocessor">#ifdef NL_DEBUG</span> +00280 <span class="preprocessor"></span> _FlushTrigger = FTSize; +00281 <span class="preprocessor">#endif</span> +00282 <span class="preprocessor"></span><span class="comment">// nlnettrace( "CBufSock::update-END size" );</span> +00283 <span class="keywordflow">return</span> <a class="code" href="a02303.html#NLNET_1_1CServerBufSockz2081_0">flush</a>(); +00284 } +00285 } +00286 <span class="comment">// nlnettrace( "CBufSock::update-END nosend" );</span> +00287 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00288 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Friends And Related Function Documentation</h2> +<a class="anchor" name="NLNET_1_1CServerBufSockn0" doxytag="NLNET::CServerBufSock::CBufClient" ></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"> friend class <a class="el" href="a02295.html">CBufClient</a><code> [friend, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Reimplemented from <a class="el" href="a02303.html#NLNET_1_1CBufSockn0">NLNET::CBufSock</a>. +<p> +Definition at line <a class="el" href="a05515.html#l00277">277</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn1" doxytag="NLNET::CServerBufSock::CBufServer" ></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"> friend class <a class="el" href="a02302.html">CBufServer</a><code> [friend]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Reimplemented from <a class="el" href="a02303.html#NLNET_1_1CNonBlockingBufSockn1">NLNET::CBufSock</a>. +<p> +Definition at line <a class="el" href="a05515.html#l00341">341</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn2" doxytag="NLNET::CServerBufSock::CCallbackClient" ></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"> friend class <a class="el" href="a02305.html">CCallbackClient</a><code> [friend, inherited]</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="a05515.html#l00083">83</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn3" doxytag="NLNET::CServerBufSock::CCallbackNetBase" ></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"> friend class <a class="el" href="a02306.html">CCallbackNetBase</a><code> [friend, inherited]</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="a05515.html#l00085">85</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn4" doxytag="NLNET::CServerBufSock::CCallbackServer" ></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"> friend class <a class="el" href="a02307.html">CCallbackServer</a><code> [friend, inherited]</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="a05515.html#l00084">84</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn5" doxytag="NLNET::CServerBufSock::CClientReceiveTask" ></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"> friend class <a class="el" href="a02352.html">CClientReceiveTask</a><code> [friend, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Reimplemented from <a class="el" href="a02303.html#NLNET_1_1CBufSockn5">NLNET::CBufSock</a>. +<p> +Definition at line <a class="el" href="a05515.html#l00278">278</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn6" doxytag="NLNET::CServerBufSock::CListenTask" ></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"> friend class <a class="el" href="a02770.html">CListenTask</a><code> [friend]</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="a05515.html#l00342">342</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockn7" doxytag="NLNET::CServerBufSock::CServerReceiveTask" ></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"> friend class <a class="el" href="a03366.html">CServerReceiveTask</a><code> [friend]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Reimplemented from <a class="el" href="a02303.html#NLNET_1_1CNonBlockingBufSockn6">NLNET::CBufSock</a>. +<p> +Definition at line <a class="el" href="a05515.html#l00343">343</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLNET_1_1CServerBufSockr0" doxytag="NLNET::CServerBufSock::_Advertised" ></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="a03365.html#NLNET_1_1CServerBufSockr0">NLNET::CServerBufSock::_Advertised</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +True after a connection callback has been sent to the user, for this connection. +<p> + +<p> +Definition at line <a class="el" href="a05515.html#l00377">377</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockp0" doxytag="NLNET::CServerBufSock::_KnowConnected" ></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="a02303.html#NLNET_1_1CServerBufSockp0">NLNET::CBufSock::_KnowConnected</a><code> [protected, inherited]</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="a05515.html#l00246">246</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00120">NLNET::CBufSock::advertiseDisconnection()</a>, <a class="el" href="a05514.html#l00295">NLNET::CBufSock::connect()</a>, <a class="el" href="a05514.html#l00315">NLNET::CBufSock::disconnect()</a>, and <a class="el" href="a05514.html#l00081">NLNET::CBufSock::~CBufSock()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockp1" doxytag="NLNET::CServerBufSock::_MaxExpectedBlockSize" ></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> <a class="el" href="a02991.html#NLNET_1_1CServerBufSockp1">NLNET::CNonBlockingBufSock::_MaxExpectedBlockSize</a><code> [protected, inherited]</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="a05515.html#l00314">314</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockr1" doxytag="NLNET::CServerBufSock::_OwnerTask" ></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="a03366.html">CServerReceiveTask</a>* <a class="el" href="a03365.html#NLNET_1_1CServerBufSockr1">NLNET::CServerBufSock::_OwnerTask</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="a05515.html#l00380">380</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00354">ownerTask()</a>, and <a class="el" href="a05515.html#l00351">setOwnerTask()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockp2" doxytag="NLNET::CServerBufSock::_ReceiveBuffer" ></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::vector<<a class="el" href="a04558.html#a7">uint8</a>> <a class="el" href="a02991.html#NLNET_1_1CServerBufSockp2">NLNET::CNonBlockingBufSock::_ReceiveBuffer</a><code> [protected, inherited]</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="a05515.html#l00311">311</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05515.html#l00298">NLNET::CNonBlockingBufSock::fillEventTypeOnly()</a>, <a class="el" href="a05515.html#l00308">NLNET::CNonBlockingBufSock::receivedBuffer()</a>, and <a class="el" href="a05514.html#l00386">NLNET::CNonBlockingBufSock::receivePart()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSocko0" doxytag="NLNET::CServerBufSock::AuthorizedCallback" ></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 <a class="el" href="a02303.html#NLNET_1_1CServerBufSocko0">NLNET::CBufSock::AuthorizedCallback</a><code> [inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Little tricky but this string is used by Layer4 to know which callback is authorized. This is empty when all callback are authorized. +<p> +Definition at line <a class="el" href="a05515.html#l00070">70</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00471">NLNET::CCallbackNetBase::authorizeOnly()</a>, <a class="el" href="a05526.html#l00223">NLNET::CCallbackNetBase::processOneMessage()</a>, and <a class="el" href="a05514.html#l00081">NLNET::CBufSock::~CBufSock()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSocko1" doxytag="NLNET::CServerBufSock::ReceiveNextValue" ></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> <a class="el" href="a02303.html#NLNET_1_1CServerBufSocko1">NLNET::CBufSock::ReceiveNextValue</a><code> [inherited]</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="a05515.html#l00074">74</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00295">NLNET::CBufSock::connect()</a>, and <a class="el" href="a05514.html#l00315">NLNET::CBufSock::disconnect()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockp3" doxytag="NLNET::CServerBufSock::SendFifo" ></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="a02301.html">NLMISC::CBufFIFO</a> <a class="el" href="a02303.html#NLNET_1_1CServerBufSockp3">NLNET::CBufSock::SendFifo</a><code> [protected, inherited]</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="a05515.html#l00240">240</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05512.html#l00713">NLNET::CBufServer::displaySendQueueStat()</a>, <a class="el" href="a05507.html#l00137">NLNET::CBufClient::displaySendQueueStat()</a>, <a class="el" href="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05512.html#l00660">NLNET::CBufServer::getSendQueueSize()</a>, <a class="el" href="a05507.html#l00135">NLNET::CBufClient::getSendQueueSize()</a>, <a class="el" href="a05515.html#l00178">NLNET::CBufSock::pushBuffer()</a>, and <a class="el" href="a05514.html#l00247">NLNET::CBufSock::update()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSocko2" doxytag="NLNET::CServerBufSock::SendNextValue" ></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> <a class="el" href="a02303.html#NLNET_1_1CServerBufSocko2">NLNET::CBufSock::SendNextValue</a><code> [inherited]</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="a05515.html#l00074">74</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00295">NLNET::CBufSock::connect()</a>, <a class="el" href="a05514.html#l00315">NLNET::CBufSock::disconnect()</a>, and <a class="el" href="a05512.html#l00299">NLNET::CBufServer::send()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLNET_1_1CServerBufSockp4" doxytag="NLNET::CServerBufSock::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"> <a class="el" href="a02445.html">CTcpSock</a>* <a class="el" href="a02303.html#NLNET_1_1CServerBufSockp4">NLNET::CBufSock::Sock</a><code> [protected, inherited]</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="a05515.html#l00243">243</a> of file <a class="el" href="a05515.html">buf_sock.h</a>. +<p> +Referenced by <a class="el" href="a05514.html#l00329">NLNET::CBufSock::asString()</a>, <a class="el" href="a05507.html#l00172">NLNET::CBufClient::bytesDownloaded()</a>, <a class="el" href="a05507.html#l00175">NLNET::CBufClient::bytesUploaded()</a>, <a class="el" href="a05514.html#l00052">NLNET::CBufSock::CBufSock()</a>, <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="a05514.html#l00315">NLNET::CBufSock::disconnect()</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="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05513.html#l00241">NLNET::CBufServer::hostAddress()</a>, <a class="el" href="a05515.html#l00178">NLNET::CBufSock::pushBuffer()</a>, <a class="el" href="a05507.html#l00169">NLNET::CBufClient::remoteAddress()</a>, <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>, <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>, <a class="el" href="a05506.html#l00296">NLNET::CBufClient::update()</a>, <a class="el" href="a05506.html#l00397">NLNET::CBufClient::~CBufClient()</a>, and <a class="el" href="a05514.html#l00081">NLNET::CBufSock::~CBufSock()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05515.html">buf_sock.h</a><li><a class="el" href="a05514.html">buf_sock.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:03:30 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> |