OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="messaging-system"> | 3 <section id="messaging-system"> |
4 <span id="message-system"></span><h1 id="messaging-system"><span id="message-sys
tem"></span>Messaging System</h1> | 4 <span id="message-system"></span><h1 id="messaging-system"><span id="message-sys
tem"></span>Messaging System</h1> |
5 <div class="contents local topic" id="contents"> | 5 <div class="contents local" id="contents" style="display: none"> |
6 <ul class="small-gap"> | 6 <ul class="small-gap"> |
7 <li><a class="reference internal" href="#reference-information" id="id2">Referen
ce information</a></li> | 7 <li><a class="reference internal" href="#reference-information" id="id2">Referen
ce information</a></li> |
8 <li><p class="first"><a class="reference internal" href="#introduction-to-the-me
ssaging-system" id="id3">Introduction to the messaging system</a></p> | 8 <li><p class="first"><a class="reference internal" href="#introduction-to-the-me
ssaging-system" id="id3">Introduction to the messaging system</a></p> |
9 <ul class="small-gap"> | 9 <ul class="small-gap"> |
10 <li><a class="reference internal" href="#design-of-the-messaging-system" id="id4
">Design of the messaging system</a></li> | 10 <li><a class="reference internal" href="#design-of-the-messaging-system" id="id4
">Design of the messaging system</a></li> |
11 </ul> | 11 </ul> |
12 </li> | 12 </li> |
13 <li><p class="first"><a class="reference internal" href="#communication-tasks-in
-the-hello-world-example" id="id5">Communication tasks in the “Hello, Worl
d” example</a></p> | 13 <li><p class="first"><a class="reference internal" href="#communication-tasks-in
-the-hello-world-example" id="id5">Communication tasks in the “Hello, Worl
d” example</a></p> |
14 <ul class="small-gap"> | 14 <ul class="small-gap"> |
15 <li><a class="reference internal" href="#javascript-code" id="id6">JavaScript co
de</a></li> | 15 <li><a class="reference internal" href="#javascript-code" id="id6">JavaScript co
de</a></li> |
16 <li><a class="reference internal" href="#native-client-module" id="id7">Native C
lient module</a></li> | 16 <li><a class="reference internal" href="#native-client-module" id="id7">Native C
lient module</a></li> |
17 </ul> | 17 </ul> |
18 </li> | 18 </li> |
19 <li><p class="first"><a class="reference internal" href="#messaging-in-javascrip
t-code-more-details" id="id8">Messaging in JavaScript code: More details.</a></p
> | 19 <li><p class="first"><a class="reference internal" href="#messaging-in-javascrip
t-code-more-details" id="id8">Messaging in JavaScript code: More details.</a></p
> |
20 <ul class="small-gap"> | 20 <ul class="small-gap"> |
21 <li><a class="reference internal" href="#setting-up-an-event-listener-and-handle
r" id="id9">Setting up an event listener and handler</a></li> | 21 <li><a class="reference internal" href="#setting-up-an-event-listener-and-handle
r" id="id9">Setting up an event listener and handler</a></li> |
22 </ul> | 22 </ul> |
23 </li> | 23 </li> |
24 <li><p class="first"><a class="reference internal" href="#messaging-in-the-nativ
e-client-module-more-details" id="id10">Messaging in the Native Client module: M
ore details.</a></p> | 24 <li><p class="first"><a class="reference internal" href="#messaging-in-the-nativ
e-client-module-more-details" id="id10">Messaging in the Native Client module: M
ore details.</a></p> |
25 <ul class="small-gap"> | 25 <ul class="small-gap"> |
26 <li><a class="reference internal" href="#implementing-handlemessage" id="id11">I
mplementing HandleMessage()</a></li> | 26 <li><a class="reference internal" href="#implementing-handlemessage" id="id11">I
mplementing HandleMessage()</a></li> |
27 <li><a class="reference internal" href="#implementing-application-specific-funct
ions" id="id12">Implementing application-specific functions</a></li> | 27 <li><a class="reference internal" href="#implementing-application-specific-funct
ions" id="id12">Implementing application-specific functions</a></li> |
28 <li><a class="reference internal" href="#sending-messages-back-to-the-javascript
-code" id="id13">Sending messages back to the JavaScript code</a></li> | 28 <li><a class="reference internal" href="#sending-messages-back-to-the-javascript
-code" id="id13">Sending messages back to the JavaScript code</a></li> |
29 <li><a class="reference internal" href="#sending-and-receiving-other-pp-var-type
s" id="id14">Sending and receiving other <code>pp::Var</code> types</a></li> | 29 <li><a class="reference internal" href="#sending-and-receiving-other-pp-var-type
s" id="id14">Sending and receiving other <code>pp::Var</code> types</a></li> |
30 </ul> | 30 </ul> |
31 </li> | 31 </li> |
32 </ul> | 32 </ul> |
33 </div> | 33 |
34 <p>This chapter describes the messaging system used to communicate between the | 34 </div><p>This chapter describes the messaging system used to communicate between
the |
35 JavaScript code and the Native Client module’s C or C++ code in a | 35 JavaScript code and the Native Client module’s C or C++ code in a |
36 Native Client application. It introduces the concept of asynchronous | 36 Native Client application. It introduces the concept of asynchronous |
37 programming and the basic steps required to set up a Native Client module | 37 programming and the basic steps required to set up a Native Client module |
38 that sends messages to and receive messages from JavaScript. This chapter | 38 that sends messages to and receive messages from JavaScript. This chapter |
39 assumes you are familiar with the material presented in the | 39 assumes you are familiar with the material presented in the |
40 <a class="reference internal" href="/native-client/devguide/coding/application-s
tructure.html"><em>Application Structure</em></a> chapter.</p> | 40 <a class="reference internal" href="/native-client/devguide/coding/application-s
tructure.html"><em>Application Structure</em></a> chapter.</p> |
41 <aside class="note"> | 41 <aside class="note"> |
42 The “Hello, World” example for getting started with NaCl is used her
e to | 42 The “Hello, World” example for getting started with NaCl is used her
e to |
43 illustrate basic programming techniques. You can find this code in | 43 illustrate basic programming techniques. You can find this code in |
44 the <code>/getting_started/part2</code> directory in the Native Client SDK downl
oad. | 44 the <code>/getting_started/part2</code> directory in the Native Client SDK downl
oad. |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 pp::VarArray keys = dictionary.GetKeys(); | 367 pp::VarArray keys = dictionary.GetKeys(); |
368 // ... | 368 // ... |
369 } else { | 369 } else { |
370 // ... | 370 // ... |
371 } | 371 } |
372 } | 372 } |
373 </pre> | 373 </pre> |
374 </section></section></section> | 374 </section></section></section> |
375 | 375 |
376 {{/partials.standard_nacl_article}} | 376 {{/partials.standard_nacl_article}} |
OLD | NEW |