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::ndm</title>
49  </head>
50  <body>
51<h1><CODE><a href="../../nn/Overview.html">nn</a>::ndm</CODE> Namespace</h1>
52<h2>Description</h2>
53    <div class="section">
54<p>Namespace for the network daemon control library.</p><p>
55A daemon is a static module that processes autonomously in the background of the application. CTR has a number of daemons for network processes.<br /><CODE>ndm (Network Daemon Manager)</CODE> is a special daemon that manages the daemons performing network processes. The <CODE>ndm</CODE> library is a library for controlling this special daemon.
56</p><h3>The Need for Daemon Control</h3><p>
57The application runs on the CPU's application core, while the daemons run in parallel on the CPU's system core. Accordingly, the daemons do not directly take away from the application's CPU time. <br />On the other hand, the application and the daemons share the network and NAND. For this reason, the activities of the daemons can in some cases impact the performance of the application.
58          </p><p>
59If a decline in network or NAND performance is fatal to the application, the <CODE>ndm</CODE> library can halt the operations of the various communication modules.<br />(For example, when a network multiplayer mode requiring low latency is started or when the scene switches to a scene that loads a large volume of data from NAND.)
60          </p><p>
61When switching to local communications or another communications mode, the various communications libraries control the daemons automatically via the <CODE>ndm</CODE> library.<br />The application developer does not have to worry about anything other than performance.
62</p><h3>Daemons Under Control of the <CODE>ndm</CODE> Library</h3><p>
63Daemons can be freely stopped, but the different daemons all have their roles to play, so there are various restrictions on the stopping of daemons. It is therefore important to understand how the stopping of any given daemon will impact the system.
64</p><h4>StreetPass Daemon (<CODE>nn::ndm::CTR::DN_CEC</CODE>)</h4><p>
65This daemon carries out StreetPass communication (<a href="../../nn/cec/Overview.html"><CODE>nn::cec</CODE></a>). Stopping this daemon completely shuts down StreetPass communications being carried out in the application background. Operations where the application does something like access the StreetPass message box can be performed as usual.
66</p><h4>SpotPass Daemon (<CODE>nn::ndm::CTR::DN_BOSS</CODE> and <CODE>nn::ndm::DN_NIM</CODE>)</h4><p>
67This daemon carries out SpotPass communication (<a href="../../nn/boss/Overview.html"><CODE>nn::boss</CODE></a>). Stopping this daemon completely shuts down SpotPass communications being carried out in the application background.<br />Operations by the application such as registering tasks, immediate execution, and acessing storage can be performed as usual.
68</p><p><CODE>nn::ndm::CTR::DN_NIM</CODE> is a supplemental module for executing system processes. We recommend that when you stop <CODE>nn::ndm::CTR::DN_BOSS</CODE>, you also stop <CODE>nn::ndm::DN_NIM</CODE> along with it.
69</p><h4>Friend presence daemon (<CODE>nn::ndm::CTR::DN_FRIENDS</CODE>)</h4><p>
70This daemon manages the friend presence feature (<a href="../../nn/friends/Overview.html"><CODE>nn::friends</CODE></a>). Stopping this daemon halts autonomous login in the application background. Operations by applications such as accessing friend information, or explicit login processes can be performed as usual.
71          </p><p>
72Note that autonomous login is not carried out during sleep, either, and behavior may appear the same as when a stop command has been issued.
73</p><table><caption><B>Reference</B> Predicted Impacts of Daemons on Applications</caption><thead><tr><th>
74Daemon <br />(<a href="../../nn/ndm/CTR/DaemonName.html"><CODE>nn::ndm::CTR::DaemonName</CODE></a>)
75</th><th>Impact on Network</th><th>Impact on NAND</th></tr></thead><tbody><tr><th><span><CODE>nn::ndm::CTR::DN_CEC</CODE></span></th><td>
76None<br />(Infrastructure communications not used)
77                </td><td>
78Moderate<br />(Approximately 10 KB to 10 MB of NAND is accessed when StreetPass is being established)
79</td></tr><tr><th><span><CODE>nn::ndm::CTR::DN_FRIENDS</CODE></span></th><td>
80Low<br />(UDP communications occur when disconnecting)
81                </td><td>
82Low
83</td></tr><tr><th><span><CODE>nn::ndm::CTR::DN_BOSS</CODE></span></th><td>
84High <br />(HTTP communications occur when task executes)
85                </td><td>
86High<br />(NAND write occurs when task executes)
87</td></tr><tr><th><span><CODE>nn::ndm::CTR::DN_NIM</CODE></span></th><td>
88High <br />(HTTP communications occur when task executes)
89                </td><td>
90High<br />(NAND write occurs when task executes)
91</td></tr></tbody></table><h3>Operations During Sleep</h3><p>
92Daemon operations cannot be controlled during sleep. Even if the application issues a stop command, behavior will be exactly the same as during sleep while the daemon has not been stopped. When the system recovers from sleep, it returns to the state before sleep. You must therefore take into account the fact that the daemon state, such as receiving new data, has changed when recovering from sleep even if the daemon is stopped.
93          </p></div>
94    <a name="namespace" id="namespace">
95<h2>Namespace</h2>
96      <div class="section">
97        <table class="members">
98          <tr>
99            <th>
100<a href="../../nn/ndm/CTR/Overview.html">nn::ndm::CTR</a>
101            </th>
102<td>Namespace for the network daemon control library. (This can also be written with &quot;<CODE>CTR</CODE>&quot; omitted.)</td>
103          </tr> </table>
104      </div>
105    </a> <a name="function" id="function">
106<h2>Functions</h2>
107      <div class="section">
108        <table class="members">
109          <tr>
110            <td width="100">  </td>
111            <th>
112<a href="../../nn/ndm/Initialize.html"><CODE>Initialize</CODE></a>
113            </th>
114<td>Initializes the network daemon control library.</td>
115          </tr>
116          <tr>
117            <td width="100">  </td>
118            <th>
119<a href="../../nn/ndm/Finalize.html"><CODE>Finalize</CODE></a>
120            </th>
121<td>Finalizes the network daemon control library.</td>
122          </tr>
123          <tr>
124            <td width="100">  </td>
125            <th>
126<a href="../../nn/ndm/SuspendDaemons.html"><CODE>SuspendDaemons</CODE></a>
127            </th>
128<td>Suspends autonomous operation of all network daemons.</td>
129          </tr>
130          <tr>
131            <td width="100">  </td>
132            <th>
133<a href="../../nn/ndm/ResumeDaemons.html"><CODE>ResumeDaemons</CODE></a>
134            </th>
135<td>Resumes autonomous operation of all network daemons.</td>
136          </tr>
137          <tr>
138            <td width="100">  </td>
139            <th>
140<a href="../../nn/ndm/Suspend.html"><CODE>Suspend</CODE></a>
141            </th>
142<td>Suspends autonomous operation of a network daemon.</td>
143          </tr>
144          <tr>
145            <td width="100">  </td>
146            <th>
147<a href="../../nn/ndm/Resume.html"><CODE>Resume</CODE></a>
148            </th>
149<td>Resumes autonomous operation of a network daemon.</td>
150          </tr>
151          <tr>
152            <td width="100">  </td>
153            <th>
154<a href="../../nn/ndm/SuspendScheduler.html"><CODE>SuspendScheduler</CODE></a>
155            </th>
156<td>Suspends the daemon manager that handles scheduling for all network daemons.</td>
157          </tr>
158          <tr>
159            <td width="100">  </td>
160            <th>
161<a href="../../nn/ndm/ResumeScheduler.html"><CODE>ResumeScheduler</CODE></a>
162            </th>
163<td>Resumes daemon scheduling.</td>
164          </tr>
165          <tr>
166            <td width="100">  </td>
167            <th>
168<a href="../../nn/ndm/SetupDaemonsDefault.html"><CODE>SetupDaemonsDefault</CODE></a>
169            </th>
170<td>Reverts network daemon operating permissions to the SDK defaults.</td>
171          </tr> </table>
172      </div>
173    </a>
174<h2>Revision History</h2>
175    <div class="section">
176      <dl class="history">
177        <dt>2010/12/10</dt>
178<dd>Updated and added information about daemons.<br />
179        </dd>
180        <dt>2010/09/17</dt>
181<dd>Initial version.<br />
182        </dd>
183      </dl>
184    </div>
185  <hr><p>CONFIDENTIAL</p></body>
186</html>
187