Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > os > by-pkgid > 9c481c872fb0ae0cbadccdc2f4a18ab6 > files > 229

libasync-devel-0.17.0-5.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Async: Async::TcpConnection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <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="navpath"><a class="el" href="namespaceAsync.html">Async</a>::<a class="el" href="classAsync_1_1TcpConnection.html">TcpConnection</a>
  </div>
</div>
<div class="contents">
<h1>Async::TcpConnection Class Reference</h1><!-- doxytag: class="Async::TcpConnection" -->
<p>A class for handling exiting TCP connections.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Async::TcpConnection:</div>
<div class="dynsection">
 <div class="center">
  <img src="classAsync_1_1TcpConnection.png" usemap="#Async::TcpConnection_map" alt=""/>
  <map id="Async::TcpConnection_map" name="Async::TcpConnection_map">
<area href="classAsync_1_1TcpClient.html" alt="Async::TcpClient" shape="rect" coords="0,56,139,80"/>
</map>
 </div>
</div>

<p><a href="classAsync_1_1TcpConnection-members.html">List of all members.</a></p>
<h2>Public Types</h2>
<ul>
<li>enum <a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">DisconnectReason</a> { <br/>
&nbsp;&nbsp;<a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4a25cf1e053ea4081403543766b7f40a34">DR_HOST_NOT_FOUND</a>, 
<a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4a79d43f05e692e509a417526564b8c252">DR_REMOTE_DISCONNECTED</a>, 
<a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4a2c3f459bfc34d34b5a421a523ae83d69">DR_SYSTEM_ERROR</a>, 
<a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4a8496d475658432471f6a9d9b0424d5ce">DR_RECV_BUFFER_OVERFLOW</a>, 
<br/>
&nbsp;&nbsp;<a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4a8b97f3b0857415cc7ffad6620121c705">DR_ORDERED_DISCONNECT</a>
<br/>
 }
<dl class="el"><dd class="mdescRight"><p>Reason code for disconnects. </p>
 <a href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">More...</a><br/></dl></ul>
<h2>Public Member Functions</h2>
<ul>
<li><a class="el" href="classAsync_1_1TcpConnection.html#ae638911f865af2d2ba71a02a5009c6da">TcpConnection</a> (size_t recv_buf_len=<a class="el" href="classAsync_1_1TcpConnection.html#a27f6e87af1a6d57eb4e3eed7a9f73a7b">DEFAULT_RECV_BUF_LEN</a>)
<dl class="el"><dd class="mdescRight">Constructor.  <a href="#ae638911f865af2d2ba71a02a5009c6da"></a><br/></dl><li><a class="el" href="classAsync_1_1TcpConnection.html#a788691251811e0bb5e5e001e314e2a3a">TcpConnection</a> (int sock, const <a class="el" href="classAsync_1_1IpAddress.html">IpAddress</a> &amp;remote_addr, uint16_t remote_port, size_t recv_buf_len=<a class="el" href="classAsync_1_1TcpConnection.html#a27f6e87af1a6d57eb4e3eed7a9f73a7b">DEFAULT_RECV_BUF_LEN</a>)
<dl class="el"><dd class="mdescRight">Constructor.  <a href="#a788691251811e0bb5e5e001e314e2a3a"></a><br/></dl><li><a class="el" href="classAsync_1_1TcpConnection.html#a2bc6a3b24ef293170ab97f3d36e128bd">~TcpConnection</a> (void)
<dl class="el"><dd class="mdescRight">Destructor.  <a href="#a2bc6a3b24ef293170ab97f3d36e128bd"></a><br/></dl><li>void <a class="el" href="classAsync_1_1TcpConnection.html#a31edfcb938751a142731bce63ace3412">disconnect</a> (void)
<dl class="el"><dd class="mdescRight">Disconnect from the remote host.  <a href="#a31edfcb938751a142731bce63ace3412"></a><br/></dl><li>int <a class="el" href="classAsync_1_1TcpConnection.html#a9c941f8e1ce95b2d6419f42b92cc32a6">write</a> (const void *buf, int count)
<dl class="el"><dd class="mdescRight">Write data to the TCP connection.  <a href="#a9c941f8e1ce95b2d6419f42b92cc32a6"></a><br/></dl><li>const <a class="el" href="classAsync_1_1IpAddress.html">IpAddress</a> &amp; <a class="el" href="classAsync_1_1TcpConnection.html#a4072ea8aef1bdd369bacba2367e8660d">remoteHost</a> (void) const 
<dl class="el"><dd class="mdescRight">Return the IP-address of the remote host.  <a href="#a4072ea8aef1bdd369bacba2367e8660d"></a><br/></dl><li>uint16_t <a class="el" href="classAsync_1_1TcpConnection.html#acc4f658b73f32acc85c79671c2f50676">remotePort</a> (void) const 
<dl class="el"><dd class="mdescRight">Return the remote port used.  <a href="#acc4f658b73f32acc85c79671c2f50676"></a><br/></dl><li>bool <a class="el" href="classAsync_1_1TcpConnection.html#a31240d2c61277733d4aff2723be6a3c8">isConnected</a> (void) const 
<dl class="el"><dd class="mdescRight">Check if the connection is established or not.  <a href="#a31240d2c61277733d4aff2723be6a3c8"></a><br/></dl></ul>
<h2>Static Public Member Functions</h2>
<ul>
<li>static const char * <a class="el" href="classAsync_1_1TcpConnection.html#ab01a0120c01f97fa4ed8d935dbe4e291">disconnectReasonStr</a> (<a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">DisconnectReason</a> reason)
<dl class="el"><dd class="mdescRight">Translate disconnect reason to a string.  <a href="#ab01a0120c01f97fa4ed8d935dbe4e291"></a><br/></dl></ul>
<h2>Public Attributes</h2>
<ul>
<li>SigC::Signal2&lt; void, <br class="typebreak"/>
<a class="el" href="classAsync_1_1TcpConnection.html">TcpConnection</a> <br class="typebreak"/>
*, <a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">DisconnectReason</a> &gt; <a class="el" href="classAsync_1_1TcpConnection.html#a839b134df486a7f756df660f84d1e2d1">disconnected</a>
<dl class="el"><dd class="mdescRight">A signal that is emitted when a connection has been terminated.  <a href="#a839b134df486a7f756df660f84d1e2d1"></a><br/></dl><li>SigC::Signal3&lt; int, <br class="typebreak"/>
<a class="el" href="classAsync_1_1TcpConnection.html">TcpConnection</a> *, void *, int &gt; <a class="el" href="classAsync_1_1TcpConnection.html#a833455297abb96d1f414bbeca7a19d96">dataReceived</a>
<dl class="el"><dd class="mdescRight">A signal that is emitted when data has been received on the connection.  <a href="#a833455297abb96d1f414bbeca7a19d96"></a><br/></dl><li>SigC::Signal1&lt; void, bool &gt; <a class="el" href="classAsync_1_1TcpConnection.html#a2a52cdcd8adf4bdb744d28931ef97075">sendBufferFull</a>
<dl class="el"><dd class="mdescRight">A signal that is emitted when the send buffer status changes.  <a href="#a2a52cdcd8adf4bdb744d28931ef97075"></a><br/></dl></ul>
<h2>Static Public Attributes</h2>
<ul>
<li>static const int <a class="el" href="classAsync_1_1TcpConnection.html#a27f6e87af1a6d57eb4e3eed7a9f73a7b">DEFAULT_RECV_BUF_LEN</a> = 1024
<dl class="el"><dd class="mdescRight">The default length of the reception buffer.  <a href="#a27f6e87af1a6d57eb4e3eed7a9f73a7b"></a><br/></dl></ul>
<h2>Protected Member Functions</h2>
<ul>
<li>void <a class="el" href="classAsync_1_1TcpConnection.html#a4b31bcdba063384b6059acea4f698703">setSocket</a> (int sock)
<dl class="el"><dd class="mdescRight">Setup information about the connection.  <a href="#a4b31bcdba063384b6059acea4f698703"></a><br/></dl><li>void <a class="el" href="classAsync_1_1TcpConnection.html#af7a3e875db395126cc82ab5fe70f6f5d">setRemoteAddr</a> (const <a class="el" href="classAsync_1_1IpAddress.html">IpAddress</a> &amp;remote_addr)
<dl class="el"><dd class="mdescRight">Setup information about the connection.  <a href="#af7a3e875db395126cc82ab5fe70f6f5d"></a><br/></dl><li>void <a class="el" href="classAsync_1_1TcpConnection.html#a8d1e774ff805f4aa4eaa618bfd3d19d4">setRemotePort</a> (uint16_t remote_port)
<dl class="el"><dd class="mdescRight">Setup information about the connection.  <a href="#a8d1e774ff805f4aa4eaa618bfd3d19d4"></a><br/></dl><li>int <a class="el" href="classAsync_1_1TcpConnection.html#a4b8420a87eaf51a479b3134ce4591908">socket</a> (void) const 
<dl class="el"><dd class="mdescRight">Return the socket file descriptor.  <a href="#a4b8420a87eaf51a479b3134ce4591908"></a><br/></dl></ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A class for handling exiting TCP connections. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Tobias Blomberg </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>2003-12-07</dd></dl>
<p>This class is used to handle an existing TCP connection. It is not meant to be used directly but could be. It it mainly created to handle connections for <a class="el" href="classAsync_1_1TcpClient.html" title="A class for creating a TCP client connection.">Async::TcpClient</a> and <a class="el" href="classAsync_1_1TcpServer.html" title="A class for creating a TCP server.">Async::TcpServer</a>. </p>
<dl><dt><b>Examples: </b></dt><dd>
<p><a class="el" href="AsyncTcpClient__demo_8cpp-example.html#_a1">AsyncTcpClient_demo.cpp</a>, and <a class="el" href="AsyncTcpServer__demo_8cpp-example.html#_a1">AsyncTcpServer_demo.cpp</a>.</p>
</dd>
</dl>
<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00123">123</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>
<hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a2a09caf85797c567d0cfce6f29ab9dd4"></a><!-- doxytag: member="Async::TcpConnection::DisconnectReason" ref="a2a09caf85797c567d0cfce6f29ab9dd4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">Async::TcpConnection::DisconnectReason</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reason code for disconnects. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a2a09caf85797c567d0cfce6f29ab9dd4a25cf1e053ea4081403543766b7f40a34"></a><!-- doxytag: member="DR_HOST_NOT_FOUND" ref="a2a09caf85797c567d0cfce6f29ab9dd4a25cf1e053ea4081403543766b7f40a34" args="" -->DR_HOST_NOT_FOUND</em>&nbsp;</td><td>
<p>The specified host was not found in the DNS. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2a09caf85797c567d0cfce6f29ab9dd4a79d43f05e692e509a417526564b8c252"></a><!-- doxytag: member="DR_REMOTE_DISCONNECTED" ref="a2a09caf85797c567d0cfce6f29ab9dd4a79d43f05e692e509a417526564b8c252" args="" -->DR_REMOTE_DISCONNECTED</em>&nbsp;</td><td>
<p>The remote host disconnected. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2a09caf85797c567d0cfce6f29ab9dd4a2c3f459bfc34d34b5a421a523ae83d69"></a><!-- doxytag: member="DR_SYSTEM_ERROR" ref="a2a09caf85797c567d0cfce6f29ab9dd4a2c3f459bfc34d34b5a421a523ae83d69" args="" -->DR_SYSTEM_ERROR</em>&nbsp;</td><td>
<p>A system error occured (check errno). </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2a09caf85797c567d0cfce6f29ab9dd4a8496d475658432471f6a9d9b0424d5ce"></a><!-- doxytag: member="DR_RECV_BUFFER_OVERFLOW" ref="a2a09caf85797c567d0cfce6f29ab9dd4a8496d475658432471f6a9d9b0424d5ce" args="" -->DR_RECV_BUFFER_OVERFLOW</em>&nbsp;</td><td>
<p>Receiver buffer overflow. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2a09caf85797c567d0cfce6f29ab9dd4a8b97f3b0857415cc7ffad6620121c705"></a><!-- doxytag: member="DR_ORDERED_DISCONNECT" ref="a2a09caf85797c567d0cfce6f29ab9dd4a8b97f3b0857415cc7ffad6620121c705" args="" -->DR_ORDERED_DISCONNECT</em>&nbsp;</td><td>
<p>Disconnect ordered locally. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00129">129</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ae638911f865af2d2ba71a02a5009c6da"></a><!-- doxytag: member="Async::TcpConnection::TcpConnection" ref="ae638911f865af2d2ba71a02a5009c6da" args="(size_t recv_buf_len=DEFAULT_RECV_BUF_LEN)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::TcpConnection::TcpConnection </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>recv_buf_len</em> = <code><a class="el" href="classAsync_1_1TcpConnection.html#a27f6e87af1a6d57eb4e3eed7a9f73a7b">DEFAULT_RECV_BUF_LEN</a></code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>recv_buf_len</em>&nbsp;</td><td>The length of the receiver buffer to use </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a788691251811e0bb5e5e001e314e2a3a"></a><!-- doxytag: member="Async::TcpConnection::TcpConnection" ref="a788691251811e0bb5e5e001e314e2a3a" args="(int sock, const IpAddress &amp;remote_addr, uint16_t remote_port, size_t recv_buf_len=DEFAULT_RECV_BUF_LEN)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::TcpConnection::TcpConnection </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classAsync_1_1IpAddress.html">IpAddress</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>remote_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>remote_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>recv_buf_len</em> = <code><a class="el" href="classAsync_1_1TcpConnection.html#a27f6e87af1a6d57eb4e3eed7a9f73a7b">DEFAULT_RECV_BUF_LEN</a></code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sock</em>&nbsp;</td><td>The socket for the connection to handle </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>remote_addr</em>&nbsp;</td><td>The remote IP-address of the connection </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>remote_port</em>&nbsp;</td><td>The remote TCP-port of the connection </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>recv_buf_len</em>&nbsp;</td><td>The length of the receiver buffer to use </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2bc6a3b24ef293170ab97f3d36e128bd"></a><!-- doxytag: member="Async::TcpConnection::~TcpConnection" ref="a2bc6a3b24ef293170ab97f3d36e128bd" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::TcpConnection::~TcpConnection </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a31edfcb938751a142731bce63ace3412"></a><!-- doxytag: member="Async::TcpConnection::disconnect" ref="a31edfcb938751a142731bce63ace3412" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::TcpConnection::disconnect </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disconnect from the remote host. </p>
<p>Call this function to disconnect from the remote host. If already disconnected, nothing will be done. The disconnected signal is not emitted when this function is called </p>

<p>Reimplemented in <a class="el" href="classAsync_1_1TcpClient.html#a673550120d3693131897629030e4ee97">Async::TcpClient</a>.</p>

</div>
</div>
<a class="anchor" id="ab01a0120c01f97fa4ed8d935dbe4e291"></a><!-- doxytag: member="Async::TcpConnection::disconnectReasonStr" ref="ab01a0120c01f97fa4ed8d935dbe4e291" args="(DisconnectReason reason)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static const char* Async::TcpConnection::disconnectReasonStr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">DisconnectReason</a>&nbsp;</td>
          <td class="paramname"> <em>reason</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Translate disconnect reason to a string. </p>

</div>
</div>
<a class="anchor" id="a31240d2c61277733d4aff2723be6a3c8"></a><!-- doxytag: member="Async::TcpConnection::isConnected" ref="a31240d2c61277733d4aff2723be6a3c8" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Async::TcpConnection::isConnected </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if the connection is established or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <em>true</em> if the connection is established or <em>false</em> if the connection is not established </dd></dl>

<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00206">206</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4072ea8aef1bdd369bacba2367e8660d"></a><!-- doxytag: member="Async::TcpConnection::remoteHost" ref="a4072ea8aef1bdd369bacba2367e8660d" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classAsync_1_1IpAddress.html">IpAddress</a>&amp; Async::TcpConnection::remoteHost </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the IP-address of the remote host. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the IP-address of the remote host</dd></dl>
<p>This function returns the IP-address of the remote host. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="AsyncTcpClient__demo_8cpp-example.html#a2">AsyncTcpClient_demo.cpp</a>, and <a class="el" href="AsyncTcpServer__demo_8cpp-example.html#a2">AsyncTcpServer_demo.cpp</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00193">193</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="acc4f658b73f32acc85c79671c2f50676"></a><!-- doxytag: member="Async::TcpConnection::remotePort" ref="acc4f658b73f32acc85c79671c2f50676" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t Async::TcpConnection::remotePort </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the remote port used. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the remote port </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="AsyncTcpServer__demo_8cpp-example.html#a3">AsyncTcpServer_demo.cpp</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00199">199</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="af7a3e875db395126cc82ab5fe70f6f5d"></a><!-- doxytag: member="Async::TcpConnection::setRemoteAddr" ref="af7a3e875db395126cc82ab5fe70f6f5d" args="(const IpAddress &amp;remote_addr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::TcpConnection::setRemoteAddr </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classAsync_1_1IpAddress.html">IpAddress</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>remote_addr</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Setup information about the connection. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>remote_addr</em>&nbsp;</td><td>The remote IP-address of the connection</td></tr>
  </table>
  </dd>
</dl>
<p>Use this function to set up the remote IP-address for the connection. </p>

</div>
</div>
<a class="anchor" id="a8d1e774ff805f4aa4eaa618bfd3d19d4"></a><!-- doxytag: member="Async::TcpConnection::setRemotePort" ref="a8d1e774ff805f4aa4eaa618bfd3d19d4" args="(uint16_t remote_port)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::TcpConnection::setRemotePort </td>
          <td>(</td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>remote_port</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Setup information about the connection. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>remote_port</em>&nbsp;</td><td>The remote TCP-port of the connection</td></tr>
  </table>
  </dd>
</dl>
<p>Use this function to set up the remote port for the connection. </p>

</div>
</div>
<a class="anchor" id="a4b31bcdba063384b6059acea4f698703"></a><!-- doxytag: member="Async::TcpConnection::setSocket" ref="a4b31bcdba063384b6059acea4f698703" args="(int sock)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::TcpConnection::setSocket </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sock</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Setup information about the connection. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sock</em>&nbsp;</td><td>The socket for the connection to handle</td></tr>
  </table>
  </dd>
</dl>
<p>Use this function to set up the socket for the connection. </p>

</div>
</div>
<a class="anchor" id="a4b8420a87eaf51a479b3134ce4591908"></a><!-- doxytag: member="Async::TcpConnection::socket" ref="a4b8420a87eaf51a479b3134ce4591908" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Async::TcpConnection::socket </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the socket file descriptor. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the currently used socket file descriptor</dd></dl>
<p>Use this function to get the socket file descriptor that is currently in use. If it is -1 it has not been set. </p>

<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00271">271</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9c941f8e1ce95b2d6419f42b92cc32a6"></a><!-- doxytag: member="Async::TcpConnection::write" ref="a9c941f8e1ce95b2d6419f42b92cc32a6" args="(const void *buf, int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Async::TcpConnection::write </td>
          <td>(</td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write data to the TCP connection. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>The buffer containing the data to send </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>The number of bytes to send from the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the number of bytes written or -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="AsyncTcpServer__demo_8cpp-example.html#a5">AsyncTcpServer_demo.cpp</a>.</dd>
</dl>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a833455297abb96d1f414bbeca7a19d96"></a><!-- doxytag: member="Async::TcpConnection::dataReceived" ref="a833455297abb96d1f414bbeca7a19d96" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SigC::Signal3&lt;int, <a class="el" href="classAsync_1_1TcpConnection.html">TcpConnection</a> *, void *, int&gt; <a class="el" href="classAsync_1_1TcpConnection.html#a833455297abb96d1f414bbeca7a19d96">Async::TcpConnection::dataReceived</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A signal that is emitted when data has been received on the connection. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>A buffer containg the read data </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>The number of bytes in the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Return the number of processed bytes</dd></dl>
<p>This signal is emitted when data has been received on this connection. The buffer will contain the bytes read from the operating system. The slot must return the number of bytes that has been processed. The bytes not processed will be stored in the receive buffer for this class and presented again to the slot when more data arrives. The new data will be appended to the old data. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="AsyncTcpServer__demo_8cpp-example.html#a4">AsyncTcpServer_demo.cpp</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00229">229</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="a27f6e87af1a6d57eb4e3eed7a9f73a7b"></a><!-- doxytag: member="Async::TcpConnection::DEFAULT_RECV_BUF_LEN" ref="a27f6e87af1a6d57eb4e3eed7a9f73a7b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int <a class="el" href="classAsync_1_1TcpConnection.html#a27f6e87af1a6d57eb4e3eed7a9f73a7b">Async::TcpConnection::DEFAULT_RECV_BUF_LEN</a> = 1024<code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The default length of the reception buffer. </p>

<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00141">141</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="a839b134df486a7f756df660f84d1e2d1"></a><!-- doxytag: member="Async::TcpConnection::disconnected" ref="a839b134df486a7f756df660f84d1e2d1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SigC::Signal2&lt;void, <a class="el" href="classAsync_1_1TcpConnection.html">TcpConnection</a> *, <a class="el" href="classAsync_1_1TcpConnection.html#a2a09caf85797c567d0cfce6f29ab9dd4">DisconnectReason</a>&gt; <a class="el" href="classAsync_1_1TcpConnection.html#a839b134df486a7f756df660f84d1e2d1">Async::TcpConnection::disconnected</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A signal that is emitted when a connection has been terminated. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>con</em>&nbsp;</td><td>The connection object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>reason</em>&nbsp;</td><td>The reason for the disconnect </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00213">213</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<a class="anchor" id="a2a52cdcd8adf4bdb744d28931ef97075"></a><!-- doxytag: member="Async::TcpConnection::sendBufferFull" ref="a2a52cdcd8adf4bdb744d28931ef97075" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SigC::Signal1&lt;void, bool&gt; <a class="el" href="classAsync_1_1TcpConnection.html#a2a52cdcd8adf4bdb744d28931ef97075">Async::TcpConnection::sendBufferFull</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A signal that is emitted when the send buffer status changes. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>is_full</em>&nbsp;</td><td>Set to <em>true</em> if the buffer is full or <em>false</em> if a buffer full condition has been cleared </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="AsyncTcpConnection_8h_source.html#l00236">236</a> of file <a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="AsyncTcpConnection_8h_source.html">AsyncTcpConnection.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address>
</body>
</html>