I am reviewing the Altia API manual -- and I have some questions about it.
I want to convert four Altia .dsn files I currently have running on one machine to be distributed as four remote .dsn clients over a network. I have a few questions regarding how to specify the host name for each client and which API calls/strategies to use.
It looks like there are two possibilities:
1) Use the -port option to specify a socket other than 5100 -- API manual page 1-9 -- and then use that port number with an altiaConnect or AtOpenConnection.
2) Use the AtStartInterface function -- API manual page 2-58 -- to load and execute a .dsn file and auto assign a socket number.
Am I understanding this correctly?
It sounds like you have it described correctly. There are actually 3 important parts: what API you use to build your application, starting the Altia Runtime on the right port and then specifying the machine/port to connect to.
1) USE THE LAN API
First of all, if you are communicating between machines, you must make sure to use the TCP/IP version of the API (not the DDE version) to build the host/controlling application. For example, you would link in [ALTIAHOME]\libfloat\ms32\liblan.lib in your MS Dev Project or Makefile (NOT libdde.lib, which is the default).
2) SPECIFY THE PORT WHEN STARTING RUNTIME
When you start the Altia Runtime on the client, you can pass in a port number on the command line. You can also specify this port number in an AtStartInterface, but you cannot use AtStartInterface to start a Runtime on another machine. So, you won't use AtStartInterface on your host machine.
To start an interface with a specific port from the command line, on the client type in something like:
altiart.exe design1.dsn -port :5200
3) SPECIFY THE PORT WHEN OPENING A CONNECTION
Once your runtime is running on the client, you need to open a connection to it. Do this using the AtOpenConnection() function and specifying the same port number as before. For example:
AtOpenConnection("client1:5200", NULL, 0, NULL);
where client1 is the machine name of the client machine.