Extending the Parallel TCP classes


Introduction

       Here the Parallel TCP classes have been enhanced to help users minimize the effort of packing and unpacking numerical values before they are sent. The methods in the extended classes pack values before sending them out on the network and unpack the values before the user accesses them. Otherwise the user will have to perform the packing and unpacking of data. This demo illustrates how various data types can be safely transported from one point to another with the help of the methods in the extended classes.


CAVERNsoft classes used

    CAVERNnet_extendedParallelTcpServer_c

                This class is derived from the CAVERNnet_parallelTcpServer_c class. The port number on which the server is to be opened is given to the init() method. After this we can use the checkForNewConnections() method to look for incoming client connections.

    CAVERNnet_extendedParallelTcpClient_c

                This class is derived from CAVERNnet_parallelTcpClient_c and can be used to create a client. It can connect to the server  using connectToServer(Machine name, Port Number, NumberofSockets). You can read or write data of various types using the methods in this class - character, integer, array of integers, 32 bit integer, array of 32 bit integers, 64 bit integers, array of 64 bit integers, long integer, array of long integer, single precision floating point value, array of float values, double precision floating point value or an array of double precision floating point values. You can choose the mode of the I/O operation (blocking or non blocking)..


Usage

 1. To run the server
          server

 2. To run a client
          client <server address>

Output

        When the server.cxx and client.cxx programs are run, the following messages are displayed :
                At server :
                    Send Float: 38293.382812
                    Send Float Array
                    array[0] = 328392.312500
                    array[1] = 328374.312500
                    array[2] = 328293.218750
                    array[3] = 271839.437500

                At client :
                        Received Float: 38293.382812
                        Received Float Array
                        array[0] = 328392.312500
                        array[1] = 328374.312500
                        array[2] = 328293.218750
                        array[3] = 271839.437500


for more information email : cavern@evl.uic.edu