Server Smalltalk Guide : Building server applications : An illustration: Ping-Pong examples
An illustration: Ping-Pong examples
PingPong is the Hello World of distributed computing. One machine sends a message to another which sends a message back. This confirms that the machines are connected and speaking the same language. The simple PingPong application also admits many variations which can be used to demonstrate different system configurations.
This is known as Ping-Pong because it follows the same pattern as the game. To accomplish this, you create an object in one image that understands ping. Its counterpart is an object in the second image that understands pong. The Server Smalltalk examples make it a bit more interesting by passing a value along with each message and then returning a result. With each message sent, the value is decremented by one. Ping-ponging stops when the value reaches 0.
Server Smalltalk comes with a large number of PingPong examples. The PingPong examples are intended to demonstrate how the facilities of Server Smalltalk are configured and used to various effects. They are not meant to be representative of any real world application or to show users how to write their distributed application.
Last modified date: 01/29/2015