|  | 
| 1 |  | -Overview | 
| 2 |  | -======== | 
|  | 1 | +# IceStorm Clock | 
|  | 2 | + | 
|  | 3 | +## Overview | 
| 3 | 4 | 
 | 
| 4 | 5 | This demo shows how to use [IceStorm][1]. | 
| 5 | 6 | 
 | 
| 6 | 7 | To run the demo, start the IceStorm service: | 
| 7 | 8 | 
 | 
| 8 |  | -``` | 
|  | 9 | +```shell | 
| 9 | 10 | icebox --Ice.Config=config.icebox | 
| 10 | 11 | ``` | 
| 11 | 12 | 
 | 
| 12 |  | -This configuration assumes there is a subdirectory named db in the | 
| 13 |  | -current working directory. | 
|  | 13 | +This configuration assumes there is a subdirectory named db in the current working directory. | 
| 14 | 14 | 
 | 
| 15 | 15 | In a separate window: | 
| 16 | 16 | 
 | 
| 17 |  | -``` | 
| 18 |  | -./Build/subscriber | 
|  | 17 | +```shell | 
|  | 18 | +swift run Subscriber | 
| 19 | 19 | ``` | 
| 20 | 20 | 
 | 
| 21 | 21 | In another window: | 
| 22 | 22 | 
 | 
| 23 |  | -``` | 
| 24 |  | -./Build/publisher | 
|  | 23 | +```shell | 
|  | 24 | +swift run Publisher | 
| 25 | 25 | ``` | 
| 26 | 26 | 
 | 
| 27 |  | -While the publisher continues to run, "tick" messages should be | 
| 28 |  | -displayed in the subscriber window. | 
|  | 27 | +While the publisher continues to run, "tick" messages should be displayed in the subscriber window. | 
| 29 | 28 | 
 | 
| 30 |  | -Options | 
| 31 |  | -======= | 
|  | 29 | +## Options | 
| 32 | 30 | 
 | 
| 33 |  | -Both the subscriber and publisher take an optional topic name as a | 
| 34 |  | -final argument. The default value for this topic is "time". | 
|  | 31 | +Both the subscriber and publisher take an optional topic name as a final argument. The default value for this topic | 
|  | 32 | +is "time". | 
| 35 | 33 | 
 | 
| 36 |  | -Through the use of command-line options, both the subscriber and | 
| 37 |  | -publisher can use different QoS for sending and receiving messages. | 
|  | 34 | +Through the use of command-line options, both the subscriber and publisher can use different QoS for sending and | 
|  | 35 | +receiving messages. | 
| 38 | 36 | 
 | 
| 39 |  | -Subscriber Options | 
| 40 |  | ------------------- | 
|  | 37 | +## Subscriber Options | 
| 41 | 38 | 
 | 
| 42 |  | -``` | 
| 43 |  | -./Build/subscriber --oneway | 
|  | 39 | +```shell | 
|  | 40 | +swift run Subscriber --oneway | 
| 44 | 41 | ``` | 
| 45 | 42 | 
 | 
| 46 |  | -The subscriber receives events as oneway messages. This is the | 
| 47 |  | -default. | 
|  | 43 | +The subscriber receives events as oneway messages. This is the default. | 
| 48 | 44 | 
 | 
| 49 |  | -``` | 
| 50 |  | -./Build/subscriber --datagram | 
|  | 45 | +```shell | 
|  | 46 | +swift run Subscriber --datagram | 
| 51 | 47 | ``` | 
| 52 | 48 | 
 | 
| 53 | 49 | The subscriber receives events as datagrams. | 
| 54 | 50 | 
 | 
| 55 |  | -``` | 
| 56 |  | -./Build/subscriber --twoway | 
|  | 51 | +```shell | 
|  | 52 | +swift run Subscriber --twoway | 
| 57 | 53 | ``` | 
| 58 | 54 | 
 | 
| 59 | 55 | The subscriber receives events as twoway messages. | 
| 60 | 56 | 
 | 
| 61 |  | -``` | 
| 62 |  | -./Build/subscriber --ordered | 
|  | 57 | +```shell | 
|  | 58 | +swift run Subscriber --ordered | 
| 63 | 59 | ``` | 
| 64 | 60 | 
 | 
| 65 |  | -The subscriber receives events as twoway messages with guaranteed | 
| 66 |  | -ordering. | 
|  | 61 | +The subscriber receives events as twoway messages with guaranteed ordering. | 
| 67 | 62 | 
 | 
| 68 |  | -``` | 
| 69 |  | -./Build/subscriber --batch | 
|  | 63 | +```shell | 
|  | 64 | +swift run Subscriber --batch | 
| 70 | 65 | ``` | 
| 71 | 66 | 
 | 
| 72 |  | -This is an additional flag that forwards datagram and oneway events | 
| 73 |  | -to the subscriber in batches. | 
|  | 67 | +This is an additional flag that forwards datagram and oneway events to the subscriber in batches. | 
| 74 | 68 | 
 | 
| 75 |  | -``` | 
| 76 |  | -./Build/subscriber --id <id> | 
|  | 69 | +```shell | 
|  | 70 | +swift run Subscriber --id <id> | 
| 77 | 71 | ``` | 
| 78 | 72 | 
 | 
| 79 |  | -This option specifies a unique identity for this subscriber. When | 
| 80 |  | -you use this option, you should also run the subscriber on a fixed | 
| 81 |  | -port by setting the `Clock.Subscriber.Endpoints` property. For | 
| 82 |  | -example: | 
|  | 73 | +This option specifies a unique identity for this subscriber. When you use this option, you should also run the | 
|  | 74 | +subscriber on a fixed port by setting the `Clock.Subscriber.Endpoints` property. For example: | 
| 83 | 75 | 
 | 
| 84 |  | -``` | 
| 85 |  | -./Build/subscriber --Clock.Subscriber.Endpoints="tcp -p <port> -h <host>" | 
|  | 76 | +```shell | 
|  | 77 | +swift run Subscriber --Clock.Subscriber.Endpoints="tcp -p <port>" | 
| 86 | 78 | ``` | 
| 87 | 79 | 
 | 
| 88 | 80 | Replace "tcp" with "udp" when using the --datagram option. | 
| 89 | 81 | 
 | 
| 90 |  | -``` | 
| 91 |  | -./Build/subscriber --retryCount <count> | 
|  | 82 | +```shell | 
|  | 83 | +swift run Subscriber --retryCount <count> | 
| 92 | 84 | ``` | 
| 93 | 85 | 
 | 
| 94 |  | -This option sets the retry count for a subscriber. This option | 
| 95 |  | -should be used in conjunction with the --id option. Setting | 
| 96 |  | -retryCount changes the default subscriber QoS to twoway. | 
|  | 86 | +This option sets the retry count for a subscriber. This option should be used in conjunction with the --id option. | 
|  | 87 | +Setting retryCount changes the default subscriber QoS to twoway. | 
| 97 | 88 | 
 | 
| 98 |  | -Publisher Options | 
| 99 |  | ------------------ | 
|  | 89 | +## Publisher Options | 
| 100 | 90 | 
 | 
| 101 |  | -``` | 
| 102 |  | -./Build/publisher --oneway | 
|  | 91 | +```shell | 
|  | 92 | +swift run Publisher --oneway | 
| 103 | 93 | ``` | 
| 104 | 94 | 
 | 
| 105 | 95 | The publisher sends events as oneway messages. This is the default. | 
| 106 | 96 | 
 | 
| 107 |  | -``` | 
| 108 |  | -./Build/publisher --datagram | 
|  | 97 | +```shell | 
|  | 98 | +swift run Publisher --datagram | 
| 109 | 99 | ``` | 
| 110 | 100 | 
 | 
| 111 | 101 | The publisher sends events as datagrams. | 
| 112 | 102 | 
 | 
| 113 |  | -``` | 
| 114 |  | -./Build/publisher --twoway | 
|  | 103 | +```shell | 
|  | 104 | +swift run Publisher --twoway | 
| 115 | 105 | ``` | 
| 116 | 106 | 
 | 
| 117 | 107 | The publisher sends events as twoway messages. | 
| 118 | 108 | 
 | 
| 119 |  | -Running the demo on several hosts | 
| 120 |  | -================================= | 
|  | 109 | +## Running the demo on several hosts | 
| 121 | 110 | 
 | 
| 122 |  | -You must modify several configuration files in order to run the | 
| 123 |  | -publisher, subscriber, and IceStorm service on separate hosts. For | 
| 124 |  | -the sake of discussion, let us assume that the processes are running | 
| 125 |  | -on the following hosts: | 
|  | 111 | +You must modify several configuration files in order to run the publisher, subscriber, and IceStorm service on | 
|  | 112 | +separate hosts. Let us assume that IceStorm is running on host `<I>`. Replace `<I>` with the appropriate hostname or | 
|  | 113 | +IP address in the steps below: | 
| 126 | 114 | 
 | 
| 127 |  | - - Host `<P>`: publisher | 
| 128 |  | - - Host `<S>`: subscriber | 
| 129 |  | - - Host `<I>`: IceStorm | 
|  | 115 | +1. Edit the subscriber's configuration file, `config.sub`, and change the `TopicManager.Proxy` property to | 
| 130 | 116 | 
 | 
| 131 |  | -Replace `<P>`, `<S>`, and `<I>` with the appropriate host names or IP | 
| 132 |  | -addresses in the steps below: | 
| 133 |  | - | 
| 134 |  | -1. Edit the subscriber's configuration file, `config.sub`, and change | 
| 135 |  | -   the `TopicManager.Proxy` property to | 
| 136 |  | -   ``` | 
|  | 117 | +   ```text | 
| 137 | 118 |    TopicManager.Proxy=DemoIceStorm/TopicManager:default -h <I> -p 10000 | 
| 138 | 119 |    ``` | 
| 139 | 120 | 
 | 
| 140 |  | -2. Edit the publisher's configuration file, `Publisher/config.pub`, and change | 
| 141 |  | -   the `TopicManager.Proxy` property to | 
| 142 |  | -   ``` | 
| 143 |  | -   TopicManager.Proxy=DemoIceStorm/TopicManager:default -h <I> -p 10000 | 
| 144 |  | -   ``` | 
|  | 121 | +2. Edit the publisher's configuration file, `config.pub`, and change the `TopicManager.Proxy` property to | 
| 145 | 122 | 
 | 
| 146 |  | -3. Since the default configurations for the subscriber and IceStorm | 
| 147 |  | -   endpoints listen only to localhost, you must also modify the Endpoints | 
| 148 |  | -   properties to explicitly include the host machine's name or IP | 
| 149 |  | -   address. | 
| 150 |  | - | 
| 151 |  | -   In `Subscriber/config.sub`: | 
| 152 |  | -   ``` | 
| 153 |  | -   Clock.Subscriber.Endpoints=tcp -h <S>:udp -h <S> | 
| 154 |  | -   ``` | 
| 155 |  | - | 
| 156 |  | -   In `config.service`: | 
| 157 |  | -   ``` | 
| 158 |  | -   IceStorm.TopicManager.Endpoints=default -h <I> -p 10000 | 
| 159 |  | -   IceStorm.Publish.Endpoints=tcp -h <I> -p 10001:udp -h <I> -p 10001 | 
|  | 123 | +   ```text | 
|  | 124 | +   TopicManager.Proxy=DemoIceStorm/TopicManager:default -h <I> -p 10000 | 
| 160 | 125 |    ``` | 
| 161 | 126 | 
 | 
| 162 |  | -If you experience any network delays or errors, edit all of the | 
| 163 |  | -configuration files and enable the `Ice.Trace.Network` property. Running | 
| 164 |  | -the processes with this property enabled displays a log of Ice's | 
| 165 |  | -network activity and may help you to identify the problem more | 
| 166 |  | -quickly. | 
|  | 127 | +If you experience any network delays or errors, edit all of the configuration files and enable the `Ice.Trace.Network` | 
|  | 128 | +property. Running the processes with this property enabled displays a log of Ice's network activity and may help you to | 
|  | 129 | +identify the problem more quickly. | 
| 167 | 130 | 
 | 
| 168 | 131 | [1]: https://doc.zeroc.com/ice/3.7/ice-services/icestorm | 
0 commit comments