Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_r_connection.html
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 6 43e37759235e
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582

<!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>TB9.2 Example Applications: CRConnection 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 -->
<div class="contents">
<h1>CRConnection Class Reference</h1><!-- doxytag: class="CRConnection" -->
<p><a href="class_c_r_connection-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a84c7cc0c77e1848e2c7abceaf98f8aa6">CRConnection</a> (CConsoleBase *aConsole)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#ace777e34413be6f891d646dbe977bfcb">~CRConnection</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a19bc66bcf8022be01b9ebababe8e8026">StartESOCK</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#acdcd4da66841b804b318afb37e4b4c1c">DemoApiWithoutDbOverrideL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#abcbc56a50819c7293323114ea940583e">DemoApiWithDbOverrideL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a9eeb4eb377993b2e4cc2c313c953bef1">AttachToExistingInterfaceL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a92ae35c52534f3a5c2bff2d0cb3ebddd">ConnectWithDbOverrideL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a9e18367074b7c5054957d262096067cd">ConnectWithoutDbOverrideL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a147d17095309f15cc007cf20271884ec">GetProgressNotification</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#ae9aa5ca6ef0e36b4b1cccd2ef7c85ef4">DisplayProgressinfo</a> (const TNifProgress &amp;aProgress)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abcc06ee8ab04739251d44a5b6959cdff"></a><!-- doxytag: member="CRConnection::DisplaySectionToDemo" ref="abcc06ee8ab04739251d44a5b6959cdff" args="(const TDesC &amp;aText)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>DisplaySectionToDemo</b> (const TDesC &amp;aText)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a7cccd60b864d9fe658eae6dcf62d79de">PrepareSocket</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a70b4e383cacd646e109d8819be8c2741">SendUdpData</a> (TUint aPayloadSize)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a466713ba7cf7584e7c4ba025c26bddff">RecvUdpData</a> (TUint aPayloadSize)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#ad1e2063ee36acfb0434006b4fdbadbb6">DataSendAndReceive</a> (TUint aPayloadSize)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a152237406ecb9b91534c869b0fcc5c54">DataTransferredRequest</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_r_connection.html#a06a6adfc62452ed190cc1d461cfa1961">DataTransferNotificationRequest</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>

<p>Definition at line <a class="el" href="rconnection_8h_source.html#l00025">25</a> of file <a class="el" href="rconnection_8h_source.html">rconnection.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a84c7cc0c77e1848e2c7abceaf98f8aa6"></a><!-- doxytag: member="CRConnection::CRConnection" ref="a84c7cc0c77e1848e2c7abceaf98f8aa6" args="(CConsoleBase *aConsole)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CRConnection::CRConnection </td>
          <td>(</td>
          <td class="paramtype">CConsoleBase *&nbsp;</td>
          <td class="paramname"> <em>aConsole</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00048">48</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ace777e34413be6f891d646dbe977bfcb"></a><!-- doxytag: member="CRConnection::~CRConnection" ref="ace777e34413be6f891d646dbe977bfcb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CRConnection::~CRConnection </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destructor. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00071">71</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a19bc66bcf8022be01b9ebababe8e8026"></a><!-- doxytag: member="CRConnection::StartESOCK" ref="a19bc66bcf8022be01b9ebababe8e8026" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::StartESOCK </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Connects to the socket server and opens a monitor for receiving interface notification. The client is notified via monitor, whenever another connection that uses a socket server (iSocketServ) goes up or down. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00083">83</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="acdcd4da66841b804b318afb37e4b4c1c"></a><!-- doxytag: member="CRConnection::DemoApiWithoutDbOverrideL" ref="acdcd4da66841b804b318afb37e4b4c1c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::DemoApiWithoutDbOverrideL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Demonstrates the following RConnection functionality: 1) requests connection/disconnection (interface up/down) notification 2) starts an explicit connection without Commdb override 3) obtains and prints connection progress information 4) prepares socket for data transfer 5) sends and receives data over the socket 6) prints the amount of data transferred 7) closes the socket and connection </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00552">552</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="abcbc56a50819c7293323114ea940583e"></a><!-- doxytag: member="CRConnection::DemoApiWithDbOverrideL" ref="abcbc56a50819c7293323114ea940583e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::DemoApiWithDbOverrideL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Demonstrates the following RConnection functionality: 1) requests connection/disconnection (interface up/down) notification 2) starts an explicit connection with CommDb override 3) obtains and prints connection progress information 4) prepares socket for data transfer 5) sends and receives data over the socket 6) requests data send and receive notification 7) closes the socket and connection </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00631">631</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a9eeb4eb377993b2e4cc2c313c953bef1"></a><!-- doxytag: member="CRConnection::AttachToExistingInterfaceL" ref="a9eeb4eb377993b2e4cc2c313c953bef1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::AttachToExistingInterfaceL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Attaches a connection to an undelying interface. This demonstrates the following RConnection functionality: 1) Opens 2 connections and starts one of them. The other is not yet associated with an underlying interface. 2) Gets the connection info of the 1st connection. 3) Attaches the 2nd connection to the existing interface, 4) Gets the current state of the attached connection. 5) Closes both connections. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00709">709</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a92ae35c52534f3a5c2bff2d0cb3ebddd"></a><!-- doxytag: member="CRConnection::ConnectWithDbOverrideL" ref="a92ae35c52534f3a5c2bff2d0cb3ebddd" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CRConnection::ConnectWithDbOverrideL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Starts an explicit connection, overriding the default Commdb connection settings. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00140">140</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a9e18367074b7c5054957d262096067cd"></a><!-- doxytag: member="CRConnection::ConnectWithoutDbOverrideL" ref="a9e18367074b7c5054957d262096067cd" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CRConnection::ConnectWithoutDbOverrideL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Starts an explicit connection using the default CommDb connection preferences. CommDb is the Symbian platform Communications Database.</p>
<p>'Explicit' means the connection is established using an RConnection instance, rather than implicitly, where the application opens and uses an RSocket or RHostResolver rather than RConnection. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00111">111</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a147d17095309f15cc007cf20271884ec"></a><!-- doxytag: member="CRConnection::GetProgressNotification" ref="a147d17095309f15cc007cf20271884ec" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::GetProgressNotification </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets progress notification about the connection. RConnection::ProgressNotification() is used to monitor the state of the connection as it undergoes various stages before it is fully established. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00176">176</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae9aa5ca6ef0e36b4b1cccd2ef7c85ef4"></a><!-- doxytag: member="CRConnection::DisplayProgressinfo" ref="ae9aa5ca6ef0e36b4b1cccd2ef7c85ef4" args="(const TNifProgress &amp;aProgress)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::DisplayProgressinfo </td>
          <td>(</td>
          <td class="paramtype">const TNifProgress &amp;&nbsp;</td>
          <td class="paramname"> <em>aProgress</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets progress information at each stage of 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>aProgress</em>&nbsp;</td><td>Filled with progress/error information on completion. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00199">199</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7cccd60b864d9fe658eae6dcf62d79de"></a><!-- doxytag: member="CRConnection::PrepareSocket" ref="a7cccd60b864d9fe658eae6dcf62d79de" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CRConnection::PrepareSocket </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Prepares the socket for carrying out data transfer by: 1) opening the socket and associating it with the connection. 2) setting options on the socket and the local port for it. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00263">263</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a70b4e383cacd646e109d8819be8c2741"></a><!-- doxytag: member="CRConnection::SendUdpData" ref="a70b4e383cacd646e109d8819be8c2741" args="(TUint aPayloadSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CRConnection::SendUdpData </td>
          <td>(</td>
          <td class="paramtype">TUint&nbsp;</td>
          <td class="paramname"> <em>aPayloadSize</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sends UDP data (an ICMP packet) over the socket specified to the address specified. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aPayloadSize</em>&nbsp;</td><td>The size of the packet to send. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Error code </dd></dl>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00296">296</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a466713ba7cf7584e7c4ba025c26bddff"></a><!-- doxytag: member="CRConnection::RecvUdpData" ref="a466713ba7cf7584e7c4ba025c26bddff" args="(TUint aPayloadSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CRConnection::RecvUdpData </td>
          <td>(</td>
          <td class="paramtype">TUint&nbsp;</td>
          <td class="paramname"> <em>aPayloadSize</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Receives UDP packet from the network </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aPayloadSize</em>&nbsp;</td><td>The size of the packet to receive </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Error code </dd></dl>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00329">329</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ad1e2063ee36acfb0434006b4fdbadbb6"></a><!-- doxytag: member="CRConnection::DataSendAndReceive" ref="ad1e2063ee36acfb0434006b4fdbadbb6" args="(TUint aPayloadSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::DataSendAndReceive </td>
          <td>(</td>
          <td class="paramtype">TUint&nbsp;</td>
          <td class="paramname"> <em>aPayloadSize</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sends and receives data. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00420">420</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a152237406ecb9b91534c869b0fcc5c54"></a><!-- doxytag: member="CRConnection::DataTransferredRequest" ref="a152237406ecb9b91534c869b0fcc5c54" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::DataTransferredRequest </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets and prints the amount of data transmitted and received. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00455">455</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a06a6adfc62452ed190cc1d461cfa1961"></a><!-- doxytag: member="CRConnection::DataTransferNotificationRequest" ref="a06a6adfc62452ed190cc1d461cfa1961" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CRConnection::DataTransferNotificationRequest </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Requests notification when an amount of data equal to a threshold value has been sent and received. The threshold used here is 100 bytes. </p>

<p>Definition at line <a class="el" href="rconnection_8cpp_source.html#l00476">476</a> of file <a class="el" href="rconnection_8cpp_source.html">rconnection.cpp</a>.</p>

</div>
</div>
</div>
<hr size="1"/><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 </small></address>
</body>
</html>