Thoroughbred® File IO Server - TBDIO

The Thoroughbred® File IO server provides remote read/write access to Thoroughbred keyed and indexed files. Access to the files is provided through TCP/IP to the PxPlus server running on your host Unix/Linux system. The TBDIO takes the request and pipes them through to a Thoroughbred application program that itself performs the IO thereby assuring proper data formatting and file integrity.

From the application perspective you have three options to access the TBDIO server:

Nice - Create the object "*plus/obj/tbdio" and use the methods to read/write/remove records.

a = new("*plus/obj/tbdio", "name_of_server")
chnl = a'Open("file")
a'ReadNext(chnl, bfr$)
...
a'Close(chnl)

The object interface provides basic methods to open, close, read, write, and remove records. Additional methods are provided to obtain the next KEY, record IND, and FID of the files.

Better - Open the file "*tbred*;file=XXXXX" where XXXXX is the file on the Tbred server

%TBDIO_Server$="name_of_server"

OPEN (chnl) "*tbred*;file=XXXXX"

By setting the name of the TBDIO server in the global variable %TBDIO_Server$, you can then directly access any file from the server by opening the logical file name *TBRED*. The pathname (or OPT=) must be followed by a FILE= option that declares the name of the desired file on the server. If desired, you can also supply a SERVER= option in the pathname (or OPT=) with the name of the TBDIO server.

Once this file is opened, your application can issue normal Read/Write/Remove/Close directives against the file along with Key/Ind/Fid functions.

Best - Create a link file accesible from the Pxplus session which links to the 'tbdio' driver and opens it.

The link file _tbred_ can be found in the PxPlus lib directory. Copy this link file to a new file (use the name of the file you wish to open in Thoroughbred). Now, when the system opens this file it will connect to the TBDIO server and it will attempt to open a Thoroughbred file of the same name.

For example:

copy <pxplus direcory>/lib/_tbred_ XXXXX

Now when you OPEN (1) "XXXXX" the system will logically issue an OPEN (1) "*tbred*;FILE=XXXXX". This results in what is basically a fully transparent access to the TBDIO serviced files for your application programs.

Technical Background:

The TBDIO Server consist of three components the PxPlus TCPIP server program, a Thoroughbred IO service program and a default IPLINPUT that is used to control Thoroughbred. The server itself is designed to be run in background on your Unix server in the directory where you have the Thoroughbred installed and from which you can run "./b" to launch Thoroughbred.

The files provided in the *plus/tbdio directory (<pxplus dir>/lib/_plus/tbdio) are as follows:

  • PLUSTIO.pls - PxPlus server program
  • PLUSTIO.tbd - Tbred file access module
  • PLUSTIO.ipl - IPLINPUT for the process

In order to run the TBDIO server, you must first copy these from the PxPlus library into your Thoroughbred directory. Once the files have been copied you can run the server. Note: you will need to modify the IPLINPUT to access you data directories.

The server, when run, expects two arguments to be passed to it from the command line:

arg 1 - Port number (default is 20,000 if not specified)
arg 2 - Shutdown password

Once initiated, the TBDIO server will launch the Thoroughbred IO sub process and begin accepting requests.

While the server itself can be killed, the best way to terminate the server is to use the Object interface 'Shutdown method. When it is called, a request will be sent to the server to shutdown. For security purposes, you have to pass the 'Shutdown method the same password you specified in Arg2 for it to take effect otherwise the shutdown command is ignored.

A typical command line to run the server would be:

/pxplus/pxplus PLUSTIO.pls -arg 20000 TaTa4Now

We suggest including this in your system 'inittab' tables.

Notice:

This feature is primarily designed to provide the application developer an easy way to continue to access either historical data files and/or provide a method by which a new ProvideX application (such as a Web application) can access data from an existing Thoroughbred application. The interface is limited to 100 files being opened concurrently.

Thoroughbred® is a registered tradmark of Thoroughbred Software International, Inc