The information in this section allows you to create a named connection to a specified TCP/IP machine name using DP4 networking. You can create named connections with the following configurations of DP4 networking:
The recommended method of using named connections is to use the
dp4dbase C++ interface to DP4. This is a source code
compatible replacement for the old DP4DYN based dp4class
interface into DP4. The only change from a traditional dp4class
program, is that the method used
to establish communication with DP4 has an optional
server_name parameter. All you have to do to create a
named connection is specify the desired server name. You should
probably avoid using the global "theConnection" available in the
dp4clex.cpp replacement dp4dbsasx.cpp in programs using named
connections. The dp4dbase files can be found in the
dp4dyn subdirectory for each release of DP4 after
4.620.
If DP4 is not running in a networked configuration, attempting to open a named connection will apparently succeed, but open a local connection!. If necessary you can use the Network Status table to check that the connection is using DP4 networking after you have created it.
In theory you can use the regular DP4 C library with named connections. However this is strongly discouraged, because of the difficulty of managing global variables such as server_handle, df_process etc. These all have to be saved and restored each time you want to switch the connection you are working with. If you want to program in C rather than C++ the best option is to use the dp4dbapi.h version of the C library. This is very similar to the usual C library, but without any global variables. dp4dbase is built around dp4dbapi.
The header file dp4dbapi.h is in the include subdirectory for DP4 releases from 4.620. You should link with ntown.lib as for a C program.