Controlling the Configuration Parameters

If you set up the database to use the default tableset and account names provided by the setup script, about which more in § 3.3.2, and both your database server and IB tws process are running on the local machine (localhost), then you may well be able to accept the defaults as is. Othewise, you will have to provide corrected connection values to the shim.

Figure 3.6: The default values for the shimrc file
\begin{figure}\small
\begin{verbatim}shim-070810$ ls -a .shimrc
.shimrcshim-...
...him
TableSet testing
FeedHost localhost
FeedPort 7496\end{verbatim}
\end{figure}

The shim will attempt to read the .shimrc configuration file, hereafter referred to simply (and imprecisely) as the ``shimrc'' or config file, if it occurs in the home or current directory. Since a default shimrc file is provided with the distribution, then the shim will see the config file if you run it in the same directory where you unpacked the sources, as in Figure 3.6.

The shim program accepts a reasonably flexible format for the config file. As shown in Figure 3.6, the file consists of name-value pairs, and those pairs may be in any order. Not all pairs need be provided; if the shimrc file is incomplete, missing values are filled in by the defaults in the source code, from the file data.c. Each pair must be on a line by itself, and the file must have left-aligned pairs only, that is without comments, blank lines, or leading whitespace.

You may also provide the connection parameters as input if you start the shim with the init option, that is if that option name occurs on the command line. In that case, the shim will prompt for the dbms and feed commands, e.g. Figure 3.7.

Figure 3.7: An init option connect dialogue
\begin{figure}\footnotesize
\begin{verbatim}Enter the dbms connect parameters ...
...edName FeedHost FeedPort;
feed tws localhost 7496;
Ok\end{verbatim}
\end{figure}

Note that the program prompts for the commands one at a time, giving the format of the command using the key names to stand for values, then echoing the input, and finally confirming the input syntax as ``Ok'' after command validation by the parser. Note also that there is at this point no assurance that the connection parameters are valid, only that they provide the expected number of strings.

There is a total of InitTime seconds, by default 20, for you to provide input in response to the command prompts, after which the shim will quit. Since for the common case such commands would be sent to the shim via a controlling script, the timeout value isn't critical, but if you're experimenting with manual input for the init option, add an entry for the timeout to your config file, and feel free to adjust it as needed.

Although you may prefer in the future to use the init option as your standard means of connection parameter input, for the purposes of this guide, and your first attempt at running the shim, please either check that the default connection parameters will work for your configuration, or else edit the default config file as needed, since the text of § 3.4 expects you to either have valid defaults, or a valid config file.

Bill Pippin 2010-01-14