basic tools

Basic tools for running and testing SVS networks.

overview of basic tools

configuring and running a server

configuring and running clients

basic SVS client commands
shell commands for SVS client

example exercise
walkthrough example of main shell commands


Example programs for SVS are found within the 'examples' directory of the download.

SVS is based around a series of networked clients that can provide different services and interfaces. The base classes for these are contained with the svs_core/network module. These are built on top of the Twisted networking library, which can be consulted for detailed information on the underlying networking layer. The clients are organised into cluster groups. A single server can support multiple groups.

page contents


A basic SVS system starts off from a server, such as in the example:

#!/usr/bin/env python

from import ClusterManager

# create server
cm = ClusterManager(9797) # <--- set to port number that server will run on

# add clients
cm.addClientAuthentication("harry", "p@ssw0rd")
cm.addClientAuthentication("sally", "p@ssw0rd")

# start server

The server is set to run on port number 9797 and has accounts created to allow 2 clients to connect to it: harry, and sally.

Launch the server with the command:


page contents


Clients can be run as command-line only units or with Graphical User Interfaces (GUI). A standard client program contains just a few lines of code:

#!/usr/bin/env python

from import GUIClient

cu = GUIClient("sally", "p@ssw0rd")
cu.connect("testgroup", "localhost", 9797)

This connects to a server runnign on the same machine, localhost, operating on port 9797, and connects to a cluster group called testgroup. It can be run from the command:


The clients for harry and sally both use the minimal GUI that is provided by the svs_core/network/ module:

fig. 1.) basic GUI for SVS clients.

This provides an input field into which commands can be entered, and text display which logs system messages from the client as well as data received over the network.

The clients support a simple shell language through commands can be used to control clients. Commands are entered into the input field and then executed when the ENTER ot RETURN key is pressed. A list of all commands supported by a client can be founf by entering commands (as shown in fig. 1).

Clients can send messages to one another using the tell command:

fig. 2.) clients chatting.

page contents

basic SVS client commands

These are the commands that can be used from the interactive shell of the SVS client console. See above for information on using the shell.

command definition
commands Get list of script commands.
disconnect Disconnect from server.
quit Disconnect from server and quit client application.
logging Turns log messages on and off.
deposit Deposit data with server-side proxy.
retrieve Collect data from server-side proxy.
cleardeposit Delete data held by server-side proxy.
getfrom Collect data from another client.
put Store data in client-side cache.
get Get data from client-side cache.
clear Delete data from client-side cache.
listen Start/stop listening to another client.
notify Send information to listeners.
tell Sends plain text message to other clients, used for chat.
clearlog Clear text from output console.
echo Turns echo of input in console on and off.
openview Open visualisation in window.*
hideview Hide visualisation in window.*
fullscreen Open fullscreen visualisation.*

table 1.) shell commands.
* - commands not active in all clients

page contents

example exercise

This exercise demonstrates some of the shell commands. Use the scripts in the 'basic_tools' directory inside the 'examples' directory of the svs distribution files. It can be run on one machine or across a network. If running across multiple machines, change the server address in the client files, '' and '', from "localhost" to the new server address.

step 1.) open a terminal and start the server:


step 2.) open a second terminal and start the 'sally' client:


A window should open for the client. When sally connects you should see a message in the server terminal:

CLUSTER MANAGER STATUS MESSAGE: Client 'sally' connected to server
CLUSTER MANAGER STATUS MESSAGE: Client 'sally' is joining cluster group 'testgroup'

Something like the following should appear in sally's terminal:

connecting to server localhost:9797 ...
connected to server.
data packet received: {'client_name': 'sally', 'client_group': 'testgroup'}
joined cluster group 'testgroup'

step 3.) enter the clearlog command in sally's input field. The output console should clear.

step 4.) enter the commands command in sally's input field. A listing of 'private' and 'public' commands should be printed in sally's output console.

>> commands
'sally' commands:

step 5.) open a third terminal and start the 'harry' client:


page contents