Removing user interface elements
xfServerPlus runs as a background process using the non-interactive dbs runtime, which does not include support for console operations. Consequently, Synergy routines that you prepare for remote access should not include user interface elements. (The user interface will be located on the xfNetLink client machine.) If any of the Synergy routines you want to access remotely require input from or send messages to the user, use the Synergy windowing API, or may generate untrapped errors, they should be adjusted to work as server-level logic. (See Non-interactive runtimes (Windows and Unix) for more information about dbs, including specifics on limited and unavailable functionality.)
UI Toolkit routines
In general, you should remove UI Toolkit routines from code that you plan to call remotely. Do not use routines that require use of the computer console (e.g., U_MESSAGE, U_POPUP) or that create or use windows (e.g., I_LDINP, T_PUTTXT). However, you can use U_START and U_FINISH, as well as file I/O and channel maintenance routines such as U_OPEN and U_CLOSE.
To use Toolkit routines with xfServerPlus, you must set the WND and SYNTXT environment variables in the xfpl.ini file (DBLDIR:SERVER_INIT.COM on OpenVMS), so that xfServerPlus knows how to resolve them. See Defining logicals for instructions. In addition, you must explicitly open the Toolkit library, tklib.elb, with a call to OPENELB or link tklib.elb to your ELB (Windows and Unix only).
If you use the U_START subroutine, you need to .INCLUDE the tools.def file. To do this, include the following code in the routine that calls U_START:
.define TOOLS_INIT .include "WND:tools.def"
You may want to exclude the global data sections of the tools.def file by defining D_NO_GLOBAL_DATA prior to including tools.def. (See tools.def.) This means that only the definitions and function declarations from tools.def will be included.
For example:
.define D_NO_GLOBAL_DATA .include "WND:tools.def"
U_START closes all channels in use from 1 through 255 if the first_channel and last_channel arguments are not passed. If those arguments are passed, it closes only channels in use in the range defined by those arguments. Either way, there’s a chance that U_START will close the channels in use by the Synergy Method Catalog files or the XFPL_LOG routine, which may result in a “Unable to access method catalog file” error ($ERR_NOOPEN). There are two possible solutions to this problem:
- If xfServerPlus is using the default base channel (243) you can set last_channel to a value less than 243.
- Use XFPL_BASECHAN to specify a non-default base channel number for xfServerPlus that is outside the range of channels specified by the first_channel and last_channel arguments. See Specifying a base channel number for more information.