Back to Main PageBack

Grid Example

Introduction

This is a simple CORBA example that makes a grid of user defined size. The grid can be imagined as a matrix with cells that can hold values. This example creates a simple grid server with user defined sizes. If the user does not define the size a default grid is created. The user can give a value to be held in the grid.

Passing the Server IOR to Clients

To keep this example simple, the server advertises its IOR in the following manner; the server program writes its server object's IOR to an ior_file. Later on, the client reads this IOR from the specified ior_file and uses the 'string_to_object' method to obtain a reference to the server object.

For this mechanism to work, the file must be readable and writable. If it doesn't exist, a new file is created by the server. Moreover, the file path must be accessible to both the client and server.

If the client and server are on different machine, then there must be a shared directory accessible by both. On UNIX systems this is typically done via the NFS mount command. On Windows, the 'explorer' application provides an option to share drives.

In general if no such file sharing option is available, then using the the Naming Service mechanism is the only alternative, as described by the -n option below. There are other command line options available for the server and client which are also explained below.

Command Line Options

Server

server [-d] [-o <IOR_file_name>] [-n]

Options

Client

client [-d] [-x] [-f <IOR_file_name>] [-k IOR] [-n] [-p] [-q] [-w] [-h] [-v]

Options