Setting up the examples
Server Smalltalk is a highly configurable framework that allows users to leverage various protocols, transports, marshaling techniques, etc. In an effort to demonstrate typical distributed configurations, SST provides a suite of examples modeled after the Ping-Pong metaphor. The SST Ping-Pong examples should be viewed collectively and studied independently. That is, even though the examples are independent of each other (e.g. SstPingPongByReference and SstPingPongByValue), they still share code and implementation through a common super class (SstPingPong).
To run the examples, you need two Smalltalk images with the SST example code loaded. You will tell one image to be Ping and the other to be Pong. Note that the examples will not run with both Ping and Pong in the same image. You can, however, run two images on the same machine. If you do this, make sure to choose different ports for each image.
When you are setting up the Ping and Pong images you will need to tell SST what communications resources to use. This is done using the transport portion of URLs as discussed in Spaces, contexts, URLs. Assuming that you are using a TCP transport, the transport portion will be tcp/host:port, for example, tcp/foo.com:1234).
When you construct your own distributed applications, you will also need to perform this step. This is nothing more than describing how your image will communicate with the outside world. In most of the Ping-Pong examples, there are a number of helper methods that help you perform this task.
For the most part, you can run the different ping-pong examples by replacing the class name SstPingPong* in the steps given below with that of the example you wish to run. Therefore if you want to run the by-reference example, you would use the corresponding class name SstPingPongByReference. Remember, you must substitute the name of the example for the '*'!
1. For the image that will be Ping, run the code below.
SstPingPong* setupPing: 'tcp/ping.com:1234' pinging: 'tcp/pong.com:5678'
2. On the machine that will be Pong run:
SstPingPong* setupPong: 'tcp/pong.com:5678' ponging: 'tcp/ping.com:1234'
Note:
As mentioned above, the Sst Ping Pong examples use a variety of helper methods to simplify the setup and configuration of the distributed infrastructure. Be aware that these are only partial URLs. The appropriate scheme is automatically added by the example code (SstPingPong>>registerInvocationConfiguration).
How each example is set up depends somewhat on its distribution semantics. For instance, the examples that use remote references are configured differently than those that pass objects around by value. It is worth exploring these methods to understand their differences.
Last modified date: 01/29/2015