Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 285

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

<!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>GNU CommonC++: ost::SimpleTCPStream Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="namespaceost.html">ost</a>::<a class="el" href="classost_1_1_simple_t_c_p_stream.html">SimpleTCPStream</a></div>
<h1>ost::SimpleTCPStream Class Reference</h1><!-- doxytag: class="ost::SimpleTCPStream" --><!-- doxytag: inherits="ost::Socket" -->Simple TCP Stream, to be used with Common C++ Library.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="socket_8h-source.html">socket.h</a>&gt;</code>
<p>
<p>Inheritance diagram for ost::SimpleTCPStream:
<p><center><img src="classost_1_1_simple_t_c_p_stream.png" usemap="#ost::SimpleTCPStream_map" border="0" alt=""></center>
<map name="ost::SimpleTCPStream_map">
<area href="classost_1_1_socket.html" alt="ost::Socket" shape="rect" coords="0,0,134,24">
</map>
<a href="classost_1_1_simple_t_c_p_stream-members.html">List of all members.</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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#dbd39bbb1872fdcb5e183d495b77d803">SimpleTCPStream</a> (<a class="el" href="classost_1_1_t_c_p_socket.html">TCPSocket</a> &amp;server, size_t size=512)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a TCP stream by accepting a connection from a bound TCP socket acting as a server.  <a href="#dbd39bbb1872fdcb5e183d495b77d803"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#097c7d9a1ea8b74f0044f14097ea7590">SimpleTCPStream</a> (const <a class="el" href="classost_1_1_i_p_v4_host.html">IPV4Host</a> &amp;host, <a class="el" href="namespaceost.html#3c74a1a40c359fd349f3e3e1b96ebfc7">tpport_t</a> port, size_t size=512)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a TCP stream by connecting to a TCP socket (on a remote machine).  <a href="#097c7d9a1ea8b74f0044f14097ea7590"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#9f5395676f24a75e7342aa1dcd5612c5">SimpleTCPStream</a> (const <a class="el" href="classost_1_1_simple_t_c_p_stream.html">SimpleTCPStream</a> &amp;source)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A copy constructor creates a new stream buffer.  <a href="#9f5395676f24a75e7342aa1dcd5612c5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#5871b832e999b5246d7116481aebbcbc">~SimpleTCPStream</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flush and empty all buffers, and then remove the allocated buffers.  <a href="#5871b832e999b5246d7116481aebbcbc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#74b4194473dc3e76fd85d35930530d16">isPending</a> (<a class="el" href="classost_1_1_socket.html#c2fe3b8bf4dfc66c7df11dfa1ce4415c">Pending</a> pend, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=TIMEOUT_INF)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the status of pending stream data.  <a href="#74b4194473dc3e76fd85d35930530d16"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#50cdae078469b3876506ca4408f69705">flush</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">ssize_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#582017e7f3c30d32b05eb68fbbb8ea1a">read</a> (char *bytes, size_t length, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read bytes into a buffer.  <a href="#582017e7f3c30d32b05eb68fbbb8ea1a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">ssize_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#671428f4e3ac21ca194dc7078b9e9489">write</a> (const char *bytes, size_t length, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write bytes to buffer.  <a href="#671428f4e3ac21ca194dc7078b9e9489"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">ssize_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#9beccece67bd498cbe82752dac492325">peek</a> (char *bytes, size_t length, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Peek at the incoming data.  <a href="#9beccece67bd498cbe82752dac492325"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#6b67fa40f1d1154f12a26c082bbb10a8">SimpleTCPStream</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The constructor required for "SimpleTCPStream", a more C++ style version of the <a class="el" href="classost_1_1_simple_t_c_p_stream.html">SimpleTCPStream</a> class.  <a href="#6b67fa40f1d1154f12a26c082bbb10a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#fab6a9450b949fe1093d8b63bc343c45">endStream</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used to terminate the buffer space and cleanup the socket connection.  <a href="#fab6a9450b949fe1093d8b63bc343c45"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_simple_t_c_p_stream.html#8c1f910e36329b69b868d062150d9c58">Connect</a> (const <a class="el" href="classost_1_1_i_p_v4_host.html">IPV4Host</a> &amp;host, <a class="el" href="namespaceost.html#3c74a1a40c359fd349f3e3e1b96ebfc7">tpport_t</a> port, size_t size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a TCP stream by connecting to a TCP socket (on a remote machine).  <a href="#8c1f910e36329b69b868d062150d9c58"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Simple TCP Stream, to be used with Common C++ Library. 
<p>
This source is derived from a proposal made by Ville Vainio (<a href="mailto:vvainio@tp.spt.fi">vvainio@tp.spt.fi</a>).<p>
<dl compact><dt><b>Author:</b></dt><dd>Mark S. Millard (<a href="mailto:msm@wizzer.com">msm@wizzer.com</a>) </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2002-08-15 Copyright (C) 2002 Wizzer Works. </dd></dl>

<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="6b67fa40f1d1154f12a26c082bbb10a8"></a><!-- doxytag: member="ost::SimpleTCPStream::SimpleTCPStream" ref="6b67fa40f1d1154f12a26c082bbb10a8" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::SimpleTCPStream::SimpleTCPStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The constructor required for "SimpleTCPStream", a more C++ style version of the <a class="el" href="classost_1_1_simple_t_c_p_stream.html">SimpleTCPStream</a> class. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="dbd39bbb1872fdcb5e183d495b77d803"></a><!-- doxytag: member="ost::SimpleTCPStream::SimpleTCPStream" ref="dbd39bbb1872fdcb5e183d495b77d803" args="(TCPSocket &amp;server, size_t size=512)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::SimpleTCPStream::SimpleTCPStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_t_c_p_socket.html">TCPSocket</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>server</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em> = <code>512</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a TCP stream by accepting a connection from a bound TCP socket acting as a server. 
<p>
This performs an "accept" call.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>server</em>&nbsp;</td><td>bound server tcp socket. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>of streaming input and output buffers. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="097c7d9a1ea8b74f0044f14097ea7590"></a><!-- doxytag: member="ost::SimpleTCPStream::SimpleTCPStream" ref="097c7d9a1ea8b74f0044f14097ea7590" args="(const IPV4Host &amp;host, tpport_t port, size_t size=512)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::SimpleTCPStream::SimpleTCPStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classost_1_1_i_p_v4_host.html">IPV4Host</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>host</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="namespaceost.html#3c74a1a40c359fd349f3e3e1b96ebfc7">tpport_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>port</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em> = <code>512</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a TCP stream by connecting to a TCP socket (on a remote machine). 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>host</em>&nbsp;</td><td>address of remote TCP server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>number to connect. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>of streaming input and output buffers. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="9f5395676f24a75e7342aa1dcd5612c5"></a><!-- doxytag: member="ost::SimpleTCPStream::SimpleTCPStream" ref="9f5395676f24a75e7342aa1dcd5612c5" args="(const SimpleTCPStream &amp;source)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::SimpleTCPStream::SimpleTCPStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classost_1_1_simple_t_c_p_stream.html">SimpleTCPStream</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>source</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A copy constructor creates a new stream buffer. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>source</em>&nbsp;</td><td>A reference to the <a class="el" href="classost_1_1_simple_t_c_p_stream.html">SimpleTCPStream</a> to copy. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="5871b832e999b5246d7116481aebbcbc"></a><!-- doxytag: member="ost::SimpleTCPStream::~SimpleTCPStream" ref="5871b832e999b5246d7116481aebbcbc" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual ost::SimpleTCPStream::~SimpleTCPStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Flush and empty all buffers, and then remove the allocated buffers. 
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="8c1f910e36329b69b868d062150d9c58"></a><!-- doxytag: member="ost::SimpleTCPStream::Connect" ref="8c1f910e36329b69b868d062150d9c58" args="(const IPV4Host &amp;host, tpport_t port, size_t size)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void ost::SimpleTCPStream::Connect           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classost_1_1_i_p_v4_host.html">IPV4Host</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>host</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="namespaceost.html#3c74a1a40c359fd349f3e3e1b96ebfc7">tpport_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>port</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [protected]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a TCP stream by connecting to a TCP socket (on a remote machine). 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>host</em>&nbsp;</td><td>address of remote TCP server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>number to connect. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>of streaming input and output buffers. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="fab6a9450b949fe1093d8b63bc343c45"></a><!-- doxytag: member="ost::SimpleTCPStream::endStream" ref="fab6a9450b949fe1093d8b63bc343c45" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void ost::SimpleTCPStream::endStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Used to terminate the buffer space and cleanup the socket connection. 
<p>
This fucntion is called by the destructor.     </td>
  </tr>
</table>
<a class="anchor" name="50cdae078469b3876506ca4408f69705"></a><!-- doxytag: member="ost::SimpleTCPStream::flush" ref="50cdae078469b3876506ca4408f69705" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void ost::SimpleTCPStream::flush           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a class="anchor" name="74b4194473dc3e76fd85d35930530d16"></a><!-- doxytag: member="ost::SimpleTCPStream::isPending" ref="74b4194473dc3e76fd85d35930530d16" args="(Pending pend, timeout_t timeout=TIMEOUT_INF)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">bool ost::SimpleTCPStream::isPending           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_socket.html#c2fe3b8bf4dfc66c7df11dfa1ce4415c">Pending</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>pend</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em> = <code>TIMEOUT_INF</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the status of pending stream data. 
<p>
This method can be used to examine if input or output is waiting, or if an error or disconnect has occured on the stream. If a read buffer contains data then input is ready. If write buffer contains data, it is first flushed and then checked.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pend</em>&nbsp;</td><td>Flag indicating means to pend. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>The length of time to wait. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="9beccece67bd498cbe82752dac492325"></a><!-- doxytag: member="ost::SimpleTCPStream::peek" ref="9beccece67bd498cbe82752dac492325" args="(char *bytes, size_t length, timeout_t timeout=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ssize_t ost::SimpleTCPStream::peek           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname" nowrap> <em>bytes</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>length</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Peek at the incoming data. 
<p>
The data is copied into the buffer but is not removed from the input queue. The function then returns the number of bytes currently pending to receive.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>bytes</em>&nbsp;</td><td>A pointer to buffer that will contain the bytes read. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>The number of bytes to read (exactly). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>Period to time out, in milleseconds.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The number of bytes pending on the input queue, 0 on EOF. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="582017e7f3c30d32b05eb68fbbb8ea1a"></a><!-- doxytag: member="ost::SimpleTCPStream::read" ref="582017e7f3c30d32b05eb68fbbb8ea1a" args="(char *bytes, size_t length, timeout_t timeout=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ssize_t ost::SimpleTCPStream::read           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname" nowrap> <em>bytes</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>length</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Read bytes into a buffer. 
<p>
&lt;long-description&gt;<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>bytes</em>&nbsp;</td><td>A pointer to buffer that will contain the bytes read. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>The number of bytes to read (exactly). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>Period to time out, in milleseconds.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The number of bytes actually read, 0 on EOF. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="671428f4e3ac21ca194dc7078b9e9489"></a><!-- doxytag: member="ost::SimpleTCPStream::write" ref="671428f4e3ac21ca194dc7078b9e9489" args="(const char *bytes, size_t length, timeout_t timeout=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ssize_t ost::SimpleTCPStream::write           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>bytes</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>length</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write bytes to buffer. 
<p>
&lt;long-description&gt;<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>bytes</em>&nbsp;</td><td>A pointer to a buffer containing the bytes to write. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>The number of bytes to write (exactly). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>Period to time out, in milleseconds.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The number of bytes actually written. </dd></dl>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="socket_8h-source.html">socket.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 19 10:50:57 2006 for GNU CommonC++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>