MultiXTpm Simple System

Open Source/Free Software

MultiXTpm Simple System is a prototype application built on top MultiXTpm Application Server. Its purpose is to demonstrate the use of MultiX Simplified API.

MultiX API provides the developer with the ability to develop complex applications that use variety of resources and communicate with other applications in different ways and protocols.

There are times where the entire MultiX API is too big and complex in order to implement simple Client/Server applications, and most of the features it provides are not required for the specific requirments, especially when there is a need to develop simple client/server applications that usually send messages sequentially  in one direction and receive responses in the other direction.

For these simple cases, MultiX Simplified API provides a simple set of functions that enables the development of Client/Server applications using as few as 3-4 function calls. This MultiX Simplified API frees the developer from the burden of learning the entire API before starting the implementation of his/her first applications.


MultiXTpm Simple System runtime environment comprises of 3 processes at the minimum:
  • MultiXTpm - Application Server, Router, load balancer.
  • MultiX Echo Client - Sends its command line argumets to the server and prints the responses from the server. 
  • MultiX Echo Server - Receives requests from clients thruogh MultiXTpm and echoes back the requests to the senders. 

MultiX Echo Client

This application is started from the command line with/without arguments.
When it is started, it initiates a connection to MultiXTpm
After the connection is established, it scans its command line arguments and it sends them to the server, one argument at time.
For each sent argument, it waits for a response from MultiXTpm. When the response is received, it is printed it to the screen.
When all arguments have been sent, it terminates.
Click here to view the source code for MultiX Echo Client

MultiX Echo Server

This application is automatically started by MultiXTpm.
After it is started, it initiates a connection to MultiXTpm and once the connection is established, it enters an endless loop of waiting for incoming requests.
When a new request arrives, it echoes back the request + some other information to the sender.

If it does not receive any message in 10 minutes or the connection with MultiXTpm is dropped or disconnected for some reason, it terminates.
Click here to view the source code for MultiX Echo Server


This is the main process within this architecture. When it starts, it reads a preconfigured XML file where all configuration data is stored in. Among other things, it starts the first instances of the other processes. When the other processes are started, it provides them with some configuration data.
MultiXTpm's main responsibilities are:
  • Monitor the other processes for unexpected termination. When it realizes that one of the processes has terminated, it restarts it if it is configured to do so.
  • When a new request arrives from MultiX Echo Client, it routes the request to one or more MultiX Echo Server processes for handling the request.
  • Monitor the queues for the MultiX Echo Server processes. Based on configuration data, MultiXTpm maintains a queue for each process.
  • Receiving a response from MultiX Echo Server processes and forward the responses back to MultiX Echo Client.
Following is a description of the Data Flow in MultiXTpm Simple System.
Each request passes thru few phases starting from connection establishment and ending with the connection closing. Between these two phases the Client is said to be "in a session".
Following is a brief description of the various phases.
  1. The client establishes a connection.
  2. The client sends a request MultiXTpm.
  3. MultiXTpm, upon receiving the new request, searches its local configuration data for an entry matching the Message Code specified in the request, it does not scan the message AT ALL. If it finds such an entry, it elects the appropriate MultiX Echo Server process and queues the message for a later forwarding to that process.
  4. If the queue for that process is empty or its size is below a preconfigured maximum, the message is forwarded immediately to the process.
  5. Upon receiving the request, MultiX Echo Server extracts the data from the request, prints the data to the screen and echoes it back to the sender, along with some additional information.
  6. When the response is received by MultiXTpm, it is forwarded back to original MultiX Echo Client who sent the request.
  7. When the response from MultiXTpm or MultiX Echo Server is received, MultiX Echo Client prints it to the screen and sends the next request if there is one.
  8. When there are no more requests, the client terminates.

Simple Server Configuration

MultiXTpm Simple Server configuration is done thru the xml file located in the runtime directory. Its default name is "TpmConfig.xml".
A description of this file and how to configure it can be found here.

Building and Using MultiXTpm Simple System.

Before using MultiXTpm Simple System you must do the followings:
  1. Follow the instructions in the ReadMe file for setting up the MultiXTpm Application Server for Win32 platform or for Linux platform.
  2. Once MultiXTpm Application Server is built and setup, change directory to MultiXTpmSimpleSystem directory.
  3. Build MultiXTpm Simple System:
    • On Win32 platform use Visual Studio 2005.
    • On Linux platform execute LinuxBuildAll.sh.
  4. Once MultiXTpm Simple System is built:
    • Make sure you are at the solution directory (MultiXTpmSimpleServer).
    • Execute MakeRuntime, This will create “runtime” directory and copy all executables and configuration file to the runtime directory.
  5. To start the system:
    • Make sure that you are at the runtime directory (MultiXTpmSimpleServer/runtime).
    • Execute MultiXTpm or MultiXTpmD (for debug) (these files are located in the runtime directory of MultiXTpm Application Server).
    • You will notice that a new window is opened; this window is where MultiXEchoServer is running. (on Linux no new window is opened).

Testing MultiXTpm Simple System

  1. Change directory to the runtime directory (MultiXTpmSimpleSystem/runtime).
  2. Execute MultiXEchoClient (with or without arguments).
  3. MultiXEchoClient sends it command line arguments to the server one line at a time, it prints what it sends and it prints the responses it receives.
  4. You will notice that when MultiXEchoServer receives the requests, it prints the requests and when it sends the responses, it prints them as well.
  5. The system is configured in a way that if there are more than 5 sessions opened to the MultiXEchoServer, MultiXTpm starts another instance of MultiXEchoServer. Since each session is cleared about 5 seconds after the actual disconnect of the client, if you run the client more than 5 times within 5 seconds, you will see that mre instances of MultiXEchoServer are created.
  6. When an instance of MultiXEchoServer becomes idle for more than 30 seconds, it is terminated by MultiXTpm, except for the last one, which is never terminated by MultiXTpm.
  7. If MultiXEchoServer instance does not receive requests within a 10 minutes period, it terminates itself. In that case, if it is the last instance, MultiXTpm will recreate a new instance.

Download information

MultiXTpm Application Server is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

MultiXTpm Application Server is distributed in source code format and it supports: Windows OS, Linux, Solaris and HP Nonstop Server OSS.

The source code is packed in ZIP file and can be downloaded from SourceForge.net.

To Access the Download Page at SourceForge.net you may click Here
Navigate to http://sourceforge.net/projects/multixtpm

Contact information

For more information, Bug Reports, Feature Requests, and Support Requests, please use:
SourceForge.net tracker
SourceForge.net Project Forums
MultiXTpm group at Yahoo Groups.
you may send an email to: Moshe Shitrit