Simple Client-Server
Client Server Interface  
   
Description This is a stripped down client server interface that allows Windx workstations to connect to a host system. It provides less functionality than either the standard *nthost process or the Application Server; however, due to the use of the ONESHOT functionality, a single port can be shared by multiple processes.
   
Client Server Interface The simplified Host/client server interface consists of three programs:

*plus/cs/host

This TCP port monitoring program runs on the server. Normally, this program will be launched from the command line. Generally, this is initiated during system startup.

Command line:

pxplus.exe *plus\cs\host [ –arg portid [ program ] ]

Where:

portid This argument contains the port id to monitor. If the portid is not supplied, port 4093 is used.
program This optional argument if supplied defines the program to be run on the server whenever a user connects. If specified the "program" parameter submited with client (workstation) setup will be ignored and placed into %LPG_USER$

For Example:

On Windows to launch this program to monitor port 12345:

pxplus.exe *plus\cs\host –arg 12345

On Unix/Linux to launch this program to monitor port 4093 and run MySys:

/pxplus/pxplus "*plus\cs\host" –arg 4093 MySys

*plus/cs/client

This client program will be run on each workstation to connect to the server. This program is normally run from the command line.

Command line:

pxplus.exe *plus\cs\client –arg server [ “program” ]

Where:

server This argument defines the server TCP address and port number separated by a semi-colon. If no port number is specified, port 10000 is assumed. The server name can be either a recognized TCP host name or a TCP/IP address consisting of a “dotted quad” (e.g. 201.129.10.23)
program This optional argument contains the program to run on the server along with any associated command line parameters and/or arguments. If this argument is not supplied, the client will be launched to standard command mode.

For Example:

pxplus.exe *plus\cs\client –arg MySrvr;12345 “*winstar –dr=c:\demo –arg main panel.en”

This would connect to the *plus/cs/host program running on a server called MySrvr on port 12345. The host program would run program *winstar in the directory c:\demo with the ARG(1) = “main” and ARG(2) = “panel.en”

*plus/cs/spawn

This utility program can be used to spawn additional sessions when running the Pvx Plus Host/client server interface. The calling sequence is:

Call “*plus/cs/spawn”, cmd_line$, fid_id$, hideflag

Where:

cmd_line$ The program name and associated arguments to be launched in a separate session.
fid_id$ The FID to use in the launched task. Generally, this will be FID(0). By default, the launched task assumes the FID(0) value of the originating task.
hideflag This parameter can be used to control whether the main window will be hidden on the launched task. If set to a non-zero value, the main window of the launched task will be hidden (minimized). Generally, you want to set this flag if you are launching a NOMADS application where the panel is a freestanding dialogue box.

Unlike NTHOST or the Application Server, there is no way to specify the INI file on the workstation to use when launching a spawned task. By default, they will use the same INI as the original session.



*Note* The standard “*windx.utl;spawn” has been altered to detect that the application is running with PxPlus Host/client server interface and will internally call the *plus/cs/spawn routines.


Global Variables The host sets the the following global variables before running your application:
%PXPLUS_HOST$ IP address and port number of the host system.
%PXPLUS_NID$ Network ID (computer name) of the workstation. (NID from local workstation)
%PXPLUS_WHO$ Userid from the workstation (WHO from local workstation)
   
Server Setup
(Windows only)
The simple client server can be installed and run on a Windows server as a system service. PxPlus includes a special installation and monitoring program call "*plus/cs/service".

To install the simple client server as a service on a Windows system simply issue RUN "*plus/cs/service". It will confirm that you wish to install the service, which directory you want it to start in, and what port number to use.

->run "*plus/cs/service"
Service Not currently installed
Do you want to install the service (Y/N):Y

Starting directory:
Port to use:
Forced Prog:

C:\Pvxsrc
4093



*Note* When installed, the system will default to "Manual" start. If you wish to have the service start automatically when the system is booted you will need to go to your Windows control panel and change the startup setting to "Automatic"..


  To alter any of the settings or to remove the service from the system, simply run the program again. It will detect that the service is already installed and ask if you wish to delete it or modify its settings.