Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 Example Echo Client & Server | 1 Example Echo Client & Server |
| 2 ==== | 2 ==== |
| 3 | 3 |
| 4 This echo client/server demonstrate how to create and use a mojom interface, | 4 This echo client/server demonstrate how to create and use a mojom interface, |
| 5 as well as demonstrating one way to communicate between mojo applications. | 5 as well as demonstrating one way to communicate between mojo applications. |
| 6 | 6 |
| 7 For more general introduction to Mojo, refer to the [Mojo | |
|
jimbe
2015/10/30 20:28:29
s/For more general introduction to Mojo/For a deep
Sean Klein
2015/10/30 22:31:54
Done.
| |
| 8 Tutorial](https://docs.google.com/document/d/1mufrtxTk8w9qa3jcnlgqsYkWlyhwEpc7aW NaSOks7ug). | |
| 9 | |
| 7 ## Running the Echo Client & Server | 10 ## Running the Echo Client & Server |
| 8 | 11 |
| 9 ``` | 12 ``` |
| 10 $ ./mojo/tools/mojob.py gn | 13 $ ./mojo/tools/mojob.py gn |
| 11 $ ./mojo/tools/mojob.py build | 14 $ ./mojo/tools/mojob.py build |
| 12 $ ./out/Debug/mojo_shell mojo:echo_client | 15 $ ./out/Debug/mojo_shell mojo:echo_client |
| 13 ``` | 16 ``` |
| 14 You should see output along the lines of: | 17 You should see output along the lines of: |
| 15 | 18 |
| 16 ``` | 19 ``` |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 This server creates an `EchoImpl` object when it is constructed, and for each | 171 This server creates an `EchoImpl` object when it is constructed, and for each |
| 169 call to `Create`, binds the request to this single implementation. A | 172 call to `Create`, binds the request to this single implementation. A |
| 170 `BindingSet` is used so that multiple requests can be bound to the same object. | 173 `BindingSet` is used so that multiple requests can be bound to the same object. |
| 171 | 174 |
| 172 ### Server 3: OneAtATimeServer | 175 ### Server 3: OneAtATimeServer |
| 173 | 176 |
| 174 This server creates an `EchoImpl` object, like the `SingletonServer`, but uses a | 177 This server creates an `EchoImpl` object, like the `SingletonServer`, but uses a |
| 175 single `Binding`, rather than a `BindingSet`. This means that when a new client | 178 single `Binding`, rather than a `BindingSet`. This means that when a new client |
| 176 connects to the OneAtATimeServer, the previous binding is closed, and a new | 179 connects to the OneAtATimeServer, the previous binding is closed, and a new |
| 177 binding is made between the new client and the interface implementation. | 180 binding is made between the new client and the interface implementation. |
| 181 | |
| 182 The OneAtATimeServer is an unusual case, as it actually contains a race | |
| 183 condition for multiple clients. If a new client binds to the server before the | |
|
jimbe
2015/10/30 20:28:29
For the first sentence, how about:
The OneAtATimeS
Sean Klein
2015/10/30 22:31:54
Done.
| |
| 184 first client managed to call EchoString, the first client's call would cause an | |
| 185 error. Unless you know what you are doing, it is advised to avoid creating a | |
|
jimbe
2015/10/30 20:28:29
s/know what you are doing/have a specific use case
Sean Klein
2015/10/30 22:31:54
Done.
| |
| 186 server like this. | |
| OLD | NEW |