I had a need to attach to two different Clarion IP Servers simultaneously. The documentation refers to the ability to do this. However, the documentation is really discussing how to change file names, not addressing multiple servers at the same time. Not what was needed.
The IP Extender templates will enable a number of powerful IP DRiver/Server functions but not what I needed in this instance.
To do what I wanted I needed to make a minor adjustment to the IPDRV.TPL template file.
Changing the IPDRV.TPL file
Step 1
Backup it up!
As you can see; lines 159,160 , 172 & 173 are commented out of the standard Template Code.
The effect :- by commenting out these 4 lines the IPDRV::OWNER Global Variable no longer replaces all Owner Attributes. The beauty of this approach is that if you have no need to access more than one IP Server leaving the Owner Name attributes blank in the dictionary will still result in IPDRV::OWNER as the default variable to enable connection.
Things to know
It’s not possible (as far as I can tell), to have two files with same label open at the same time. No surprise, as it’s not possible in non-IP enable applications either.
The process I went through...
Step 1
Create the Global Variables you’ll use instead of IPDRV::OWNER (The default variable)
In my case I’ve created a separate Group called IPDRV in my dictionary.
As we’re trying to replace the default IPDRV::OWNER variable I suggest that we create the variables with the same attributes.
Leave the “generate last” option unselected as the application will need to have the Global Variables used defined/generated prior to the file declarations.
Step 2
Copy the table structure/s (either to a new dictionary or into an existing) from the second (or third) dictionary that you’re going to use. Since my application is only able to use a single dictionary (I believe this is true of all Clarion applications), I needed to make sure that the data structure matched the structure used in the original dictionary.
Step 3
In the Owner Name attribute enter the Global Variable to be used preceded by the ! (exclamation mark).
Save and exit.
TIP :- Leave the Owner Name blank if this table is going to be accessed via the default IP Server.
Step 4
Generate the Data Manager DLL - this will create/update the IPS file for your IP Driver enable application.
Step 5
Open your Application
Step 6
Assign the values required to the Alternate Global Variables. I’ve done this in the Program Setup after the “Assigning IPDRV::OWNER” embed.
TIP : - Don’t forget to provide the default IPDRV::OWNER values in the IP Driver Client Global Template extension
You could store the details of the alternate IP Servers in an INI file a local file or even in an IP Server Table.
Summary
These simple changes in the IPDV.TPL Template file extend the power of the IP Driver/Server combination without changing the more common default single IP Server.
In our case we needed to have two different applications communicate a small subset of their data between one another.
This ability allows you to at the minimum
- Roll your own registration server using the IP Driver/Server
- Create Data Connectors between servers where the data resides on different IP Servers
Disclaimer
Please note that I have not yet assessed the full impact of these changes on the other aspects of the IP Driver/Server environment.