| 1 |
|
| 2 |
|
| 3 |
Member example shows how you can build a simple multicast group |
| 4 |
using transactional multicast (TMCast). Each member can be either |
| 5 |
a sender or a receiver. |
| 6 |
|
| 7 |
The sender sends small messages to the multicast group with a random |
| 8 |
wait period in [0, 1] second range. The receiver is simply receiving |
| 9 |
those messages and prints them out. |
| 10 |
|
| 11 |
To start the sender you can execute something like this: |
| 12 |
|
| 13 |
$ ./member s sender-1 239.255.0.1:10000 |
| 14 |
|
| 15 |
Here the first argument ('s') indicates that new member will be |
| 16 |
a sender. The second argument ('sender-1') is an id of the new |
| 17 |
member (each member of the group should have a unique id). And |
| 18 |
the third argument ('239.255.0.1:10000') specifies IPv4 multicast |
| 19 |
address and port (you can choose you own). |
| 20 |
|
| 21 |
To start the receiver you can execute similar command: |
| 22 |
|
| 23 |
$ ./member r receiver-1 239.255.0.1:10000 |
| 24 |
|
| 25 |
After you have started both the receiver and the sender you |
| 26 |
should see a sequence of messages printed by the receiver. |
| 27 |
|
| 28 |
Note, since the group can exist with only one member for a |
| 29 |
very short period of time you should start first two members |
| 30 |
virtually at the same time. See TMCast documentation for more |
| 31 |
information about why it behaves this way. |
| 32 |
|
| 33 |
You may want to add more than one sender to the group if you |
| 34 |
want to see how TMCast operates in a totally-ordered mode. |
| 35 |
|
| 36 |
|
| 37 |
-- |
| 38 |
Boris Kolpackov <[email protected]> |