Environment Configuration
This chapter describes the TCP/IP service gateway environment configuration and environment file.
1. Overview
To configure an SVCGW server, the following files must exist.
-
UNIX
The following table shows the environment files used in UNIX.
Directory File Name Lib
tmaxcom.a, tmaxcom.so
Lib64
ttmaxcom.a, tmaxcom.so
Appbin
tcpsvcgw
-
Windows
The following table shows the environment files used in Windows.
Directory File Name Lib
tmaxcom.lib, tmaxcom.dll
bin
tcpsvcgw.exe
2. Tmax Environment Configuration
To use SVCGW, SVCGW must be configured as a server in the Tmax environment file. Configuration is similar to the USC server among Tmax servers except that SVRTYPE is CUSTOM_GATEWAY instead of UCS. For SVCGW, only the SERVER and SERVICE sections have to be configured.
The following is an example of a Tmax environment file.
*DOMAIN tmax SHMKEY = 88000, MINCLH = 1, MAXCLH=1, TPORTNO=8800 *NODE tmax1 TMAXDIR=”/home/tmax”, APPDIR=”/home/tmax/appbin” *SVRGROUP svg1 NODENAME=tmax1 *SERVER tcpsvcgw SVGNAME=svg1, MIN=1, MAX=1, CPC=10, SVRTYPE=CUSTOM_GATEWAY, CLOPT=”-- -P 8090 -F /home/tmax/config/tcpsvcgw.cfg –N 20” *SERVICE TCPSVC1 SVRNAME= tcpsvcgwgv TCPSVC2 SVRNAME= tcpsvcgw
Item | Description |
---|---|
MIN |
Number of SVCGW processes. It must always be set to 1. |
CPC |
Number of channels between the Tmax engine and SVCGW. When a Tmax client initiates a service call to the remote node, the CPC count must be set to the number of concurrent requests. When the remote node initiates the call, SVCGW makes a request to the Tmax engine through tpacall which does not require as many channels. |
CLOPT |
Refer to the "CLOPT Item (SVCGW Option)". |
SVCTIME |
SVCGW does not apply the service timeout for services requested to the remote node. A service is requested to the remote node and the reply is processed through a separate service and so the service timeout is not used. |
CLOPT Item (SVCGW Option)
Since the items that can be registered in the Tmax configuration file for SVCGW are limited, some options must be configured in the CLOPT item. The following options that define the operations of SVCGW must be well understood.
Option | Description |
---|---|
[-F] |
File with the remote node information and the service name that that SVCGW uses to find the remote node. SVCGW uses the file information specified in this option to connect to the remote node. The file can also be used to find the remote node through the service name specified by a Tmax service or client. For information on how to register the file, refer to SVCGW Environment File. |
[-P] |
SVCGW always runs in the server mode. The remote node uses the server address of SVCGW and the port number specified in this option. Since SVCGW can simultaneously listen to multiple port numbers, all ports that the remote nodes want to connect to need to be configured in this option. (e.g.,“8880,8881,8882”) |
[-q] |
When a Tmax service is requested from the remote node, deferred processing can be used. That is, temporary data are stored in the RQ on Tmax and later batch processed. This option is used to configure the RQ name. |
[-A] |
Option to send/receive ACK/NAK messages during data transmission between SVCGW and the remote node. Tmax SVCGW internally processes ACK/NAK messages, but the COM library of the remote node doesn’t process ACK/NAK messages. Therefore, the user program must process them. (default value: do not send/receive ACK/NAK) |
[-N] |
A remote node can be registered either by using the ComOpen function, or setting the node information using the [-F] option without directly configuring the information in the environment file. However, this may cause a problem later when executing ComOpen because the total number of remote nodes to register is unknown. This option is used to specify the total number of the remote nodes. Use the greater value by comparing the number of remote nodes set in the environment file with the number set in this option. |
2.1. ACK/NAK Messages
The following is the SVCGW environment configuration for receiving ACK/NAK messages.
*DOMAIN ... *NODE ... *SVRGROUP ... *SERVER tcpsvcgw SVGNAME=svg1, MIN=1, MAX=1, CPC=10, SVRTYPE=CUSTOM_GATEWAY, CLOPT=”-- -P 8090 -F /home/tmax/config/tcpsvcgw.cfg –N 20 -A ” *SERVICE TCPSVC1 SVRNAME= tcpsvcgw
When the environment file is created as in the previous example, an SVCGW named tcpsvcgw starts when Tmax starts up. The service name of tcpsvcgw is TCPSVC1. SVCGW must send/receive ACK/NAK messages when it is sending/receiving data to/from the remote node. Therefore, ACK/NAK messages must be taken into account when developing a program on the remote node.
2.2. Deferred Processing
The following is the environment configuration for using deferred processing through RQ in SVCGW.
*DOMAIN ... *NODE ... *SVRGROUP ... *SERVER tcpsvcgw SVGNAME=svg1, MIN=1, MAX=1, CPC=10, SVRTYPE=CUSTOM_GATEWAY, CLOPT=”-- -P 8090 -F /home/tmax/config/tcpsvcgw.cfg –N 20 –q testq ” *SERVICE TCPSVC1 SVRNAME= tcpsvcgw
When the environment file is created as in the previous example and service is requested from the remote node to Tmax through the COM library (set COMMDELAY in flags), then SVCGW stores the requested data in "testq". Since SVCGW only stores the data from the remote node in RQ, the user program must process the data stored in RQ.
3. SVCGW Environment File
The file specified using the [-F] option in the CLOPT section of the Tmax environment file must be registered in the format described in the following. This file registers the node address and service name.
3.1. Address Information File
SVCGW internally allocates buffers based on the greater value of the number defined in the environment file or the number specified with the [-N] option, and processes them using multiplexing.
The following describes the address information file and its items.
####################################################### # TCP/IP Service Gateway Config # ####################################################### # gwno ipaddr Tmaxsvc # 0 1.1.1.1 SVC ####################################################### # line start with "#" is comment line # gwno must start at 0 and be increased by 1 # ipaddr: remote node ipaddr # svc: tmax service name ####################################################### 0 1.1.1.1 SVC1
Item Name | Description |
---|---|
Gateway Number |
Used only when the MIN value of the Tmax environment file is larger than 2. Since the MIN value is always 1, this item must always be set to 0. |
ipaddr |
Address of the remote node. SVCGW uses this address to find the target service name when connecting from the remote node. |
Service Name |
When a Tmax client or service initiates a service request to a specific remote node, SVCGW must be informed of the remote node information. If SVCGW is called with the service name specified in this option, SVCGW finds the remote node and send data to the remote node. The service name specified here must be a service name configured in the SERVICE section of the Tmax environment file. SVCGW can find the remote node either by using the service name as previously described, or by specifying the remote node name when making a connection from the remote node to SVCGW. In the latter method, the specified remote name must be configured in the SERVICE section of the Tmax environment file. |