1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21      span.virtual_style
22      {
23        font-size			 : 8pt;
24        color				 : white;
25        font-weight			: bold;
26        background			: #0a0;
27        border-left			: solid 1px #0f0;
28        border-top			: solid 1px #0f0;
29        border-right		: solid 1px #060;
30        border-bottom		: solid 1px #060;
31        padding-left		: 2px;
32        padding-right		: 2px;
33      }
34      span.protected_style
35      {
36        font-size			 : 8pt;
37        color				 : white;
38        font-weight			: bold;
39        background			: #444;
40        border-left			: solid 1px #ccc;
41        border-top			: solid 1px #ccc;
42        border-right		: solid 1px #222;
43        border-bottom		: solid 1px #222;
44        padding-left		: 2px;
45        padding-right		: 2px;
46      }
47        --></style>
48<title>nn::rdt::CTR::Receiver</title>
49  </head>
50  <body>
51<h1><CODE>nn::rdt::CTR::Receiver</CODE> Class</h1>
52<h2>Syntax</h2>
53    <div class="section">
54      <pre class="definition">class Receiver</pre>
55    </div>
56<h2>Description</h2>
57    <div class="section">
58<p>Class that represents a device that receives data.</p><p>The process below shows how to use the <CODE>Receiver</CODE> class. Although the description below leaves out calls to <a href="../../../../nn/rdt/CTR/Receiver/Process.html"><CODE>Process</CODE></a>, in practice <a href="../../../../nn/rdt/CTR/Receiver/Process.html"><CODE>Process</CODE></a> must be called periodically (at least every game frame).</p><p>1. Create an instance of the <CODE>Receiver</CODE> class.</p><p>2. Call <a href="../../../../nn/rdt/CTR/Receiver/Initialize.html"><CODE>Initialize</CODE></a> to initialize the instance. (This assigns memory that the <CODE>Receiver</CODE> instance will use as working memory and receive buffer.)</p><p>3. Call <a href="../../../../nn/rdt/CTR/Receiver/Wait.html"><CODE>Wait</CODE></a> to wait for a <CODE>Sender</CODE> instance to connect.</p><p>4. Once the state transitions to <CODE>RECEIVER_STATE_OPENED</CODE>, call <a href="../../../../nn/rdt/CTR/Receiver/Receive.html"><CODE>Receive</CODE></a> periodically. As data arrives, write it to a region that has been prepared by the application.</p><p>5. Once the state transitions to <CODE>RECEIVER_STATE_FINISHED</CODE>, confirm that the data size readable by <a href="../../../../nn/rdt/CTR/Receiver/Receive.html"><CODE>Receive</CODE></a> is now zero. Then call <a href="../../../../nn/rdt/CTR/Receiver/Close.html"><CODE>Close</CODE></a>.</p><p>6. Once the state transitions to <CODE>RECEIVER_STATE_CLOSED</CODE>, call <a href="../../../../nn/rdt/CTR/Sender/Finalize.html"><CODE>Finalize</CODE></a> to finalize the <CODE>Receiver</CODE> class.</p><!-- write here --></div>
59    <a name="constant" id="constant">
60<h2>Member Constants</h2>
61      <div class="section">
62        <table class="members">
63          <tr>
64            <td width="100">
65<span class="static_style" title="static">S</span>
66            </td>
67            <th>
68<span class="argument"><a href="../../../../nn/rdt/CTR/Receiver/RECEIVER_WORKBUF_SIZE.html"><CODE>RECEIVER_WORKBUF_SIZE</CODE></a></span>
69            </th>
70<td>Size of the working memory required by the <CODE>Receiver</CODE> instance.</td>
71          </tr> </table>
72      </div>
73    </a> <a name="function" id="function">
74<h2>Member Functions</h2>
75      <div class="section">
76        <table class="members">
77          <tr>
78            <td width="100">  </td>
79            <th>
80<a href="../../../../nn/rdt/CTR/Receiver/Receiver.html"><CODE>Receiver</CODE></a>
81            </th>
82<td>Constructor.</td>
83          </tr>
84          <tr>
85            <td width="100">  </td>
86            <th>
87<a href="../../../../nn/rdt/CTR/Receiver/~Receiver.html"><CODE>~Receiver</CODE></a>
88            </th>
89<td>Destructor.</td>
90          </tr>
91          <tr>
92            <td width="100">  </td>
93            <th>
94<a href="../../../../nn/rdt/CTR/Receiver/Initialize.html"><CODE>Initialize</CODE></a>
95            </th>
96<td>Initializes an instance.</td>
97          </tr>
98          <tr>
99            <td width="100">  </td>
100            <th>
101<a href="../../../../nn/rdt/CTR/Receiver/Finalize.html"><CODE>Finalize</CODE></a>
102            </th>
103<td>Frees resources that were used by a <CODE>Receiver</CODE> instance, including the receive buffer and the endpoint descriptor(s).</td>
104          </tr>
105          <tr>
106            <td width="100">  </td>
107            <th>
108<a href="../../../../nn/rdt/CTR/Receiver/Wait.html"><CODE>Wait</CODE></a>
109            </th>
110<td>Issues a request to wait for a connection.</td>
111          </tr>
112          <tr>
113            <td width="100">  </td>
114            <th>
115<a href="../../../../nn/rdt/CTR/Receiver/Close.html"><CODE>Close</CODE></a>
116            </th>
117<td>Issues a request to revert an instance to the <CODE>CLOSED</CODE> state.</td>
118          </tr>
119          <tr>
120            <td width="100">  </td>
121            <th>
122<a href="../../../../nn/rdt/CTR/Receiver/Receive.html"><CODE>Receive</CODE></a>
123            </th>
124<td>Reads the data that has accumulated in the receive buffer.</td>
125          </tr>
126          <tr>
127            <td width="100">  </td>
128            <th>
129<a href="../../../../nn/rdt/CTR/Receiver/Process.html"><CODE>Process</CODE></a>
130            </th>
131<td>Proceeds with communication. The actual communication takes place within this function.</td>
132          </tr>
133          <tr>
134            <td width="100">  </td>
135            <th>
136<a href="../../../../nn/rdt/CTR/Receiver/Cancel.html"><CODE>Cancel</CODE></a>
137            </th>
138<td>Cancels processing.</td>
139          </tr>
140          <tr>
141            <td width="100">  </td>
142            <th>
143<a href="../../../../nn/rdt/CTR/Receiver/GetStatus.html"><CODE>GetStatus</CODE></a>
144            </th>
145<td>Gets the status of a <CODE>Receiver</CODE> instance.</td>
146          </tr>
147          <tr>
148            <td width="100">  </td>
149            <th>
150<a href="../../../../nn/rdt/CTR/Receiver/SetPacketLossRatio.html"><CODE>SetPacketLossRatio</CODE></a>
151            </th>
152<td>Virtually sets the packet loss ratio (for debugging). This function may be removed in a future release without notice.</td>
153          </tr>
154          <tr>
155            <td width="100">  </td>
156            <th>
157<a href="../../../../nn/rdt/CTR/Receiver/PrintDebugInfo.html"><CODE>PrintDebugInfo</CODE></a>
158            </th>
159<td>Prints detailed information about the internal state of a <CODE>Receiver</CODE> instance (for debugging). This function may be removed in a future release without notice.</td>
160          </tr> </table>
161      </div>
162    </a>
163<h2>Revision History</h2>
164    <div class="section">
165      <dl class="history">
166        <dt>2010/06/14</dt>
167<dd>Initial version.<br />
168        </dd>
169      </dl>
170    </div>
171  <hr><p>CONFIDENTIAL</p></body>
172</html>
173