Environment Configuration
This chapter describes the TCPGWTHR environment configuration and environment file.
1. Overview
To configure a TCPGWTHR server, the following files must exist according to the OS type.
-
UNIX
Directory File Name lib
libtcpgwhdr.a, libtcpgwhdr.so, libtmaxgw.a, libtmaxgw.so, libtmaxgwmt.a, libtmaxgwmt.so
lib64
libtcpgwhdr.a, libtcpgwhdr.so, libtmaxgw.a, libtmaxgw.so, libtmaxgwmt.a, libtmaxgwmt.so
appbin
tcpgwlsn, clihdrshm, tcpgwlsn64, clhhdrshm64
usrinc
tcphdr.h, hlinkapi.h
-
Windows
Directory File Name lib
tcpgwhdr.lib, tcpgwhdr.dll, tmaxgw.lib, tmaxgw.dll, tmaxgwmt.lib, tmaxgwmt.dll
bin
tcpgwlsn.exe, clihdrshm.exe
usrinc
tcphdr.h, hlinkapi.h
2. Tmax Environment Configuration
To use TCPGWTHR, the listener or clishm process, and the handler process 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 TCPGWTHR, only the SERVER and the SERVICE sections have to be configured.
The following is a Tmax environment file example.
*DOMAIN tmax SHMKEY = 88000, MINCLH = 1, MAXCLH = 1, TPORTNO = 8800 *NODE tmax1 TMAXDIR = "/home/tmax", APPDIR = "/home/tmax/appbin" *SVRGROUP svg1 NODENAME = tmax1 *SERVER tcpgwlsn SVGNAME = svg1, MIN = 1, MAX = 1, SVRTYPE = CUSTOM_GATEWAY, RESTART = N, CLOPT = "-- -P 1029 -N 3 -k 98765" tcpgwhdr1 SVNAME = svg1, MIN = 3, MAX = 3, SCHEDULE = RR, SVRTYPE = CUSTOM_GATEWAY, CPC = 10, TARGET = tcpgwhdr, CLOPT = "-- -P 1029 -N 10 -s –L tcpgwlsn" *SERVICE svcgw SVRNAME = tcpgwhdr1
CLOPT Item (TCPGWTHR Option)
Since the items that can be registered in the Tmax configuration file for TCPGWTHR are limited, some options must be configured in the CLOPT item. The following options that define the operations of TCPGWTHR must be well understood.
-
Listener Option
The following table describes the listener options.
Option Description [-F]
Option to run in the dedicated mode. Enter a full path for the gateway environment file path. For information on how to register the file, refer to TCPGWTHR Environment File.
[-P]
Port number for listening.
[-k]
Shared memory key used for sharing information within the gateway. Uses the entered key and key +1.
[-N]
Number of handler processes. If the MIN value of the handler process is used, the handler process' MIN and MAX must be set to the same value.
[-w]
Port number used in the gateway for Windows.
[-X SERVER_IPV6=[Y/N]]
Option to use the IPv6 protocol when creating a listener socket. If set to 'Y', IPv6 protocol is used. Otherwise, IPv4 protocol is used. (Default Value : N)
-
Handler Option
The following table describes the handler option.
Option Description [-F]
Gateway environment file for multi-connection in the client mode. Enter a full path for the gateway environment file path. For information on how to register the file, refer to TCPGWTHR Environment File. IPv6 protocol is supported.
[-r]
IP or hostname of the non-Tmax server to connect to in the client mode (single connection). IPv6 protocol is supported.
[-P]
Port number of the listener in the server mode. This is the non-Tmax server’s port number when in the client mode (single connection).
[-k]
Shared memory key used for sharing information within the gateway. Uses the entered key and key +1.
[-s]
Option to run the handler process in the server mode or client mode.
[-N]
The handler process specifies the number of threads for each handler. When the gateway environment file is specified in the server mode, threads can be allocated by calculating the number of threads for each handler by referring to the file without a specifying this option.
In the client mode, set to 1 for a single connection, and to the number of accesses needed or do not specify for multi connections. When not specified, threads are allocated by referring to the gateway environment file specified in the handler’s [-F] option.
[-w]
Port number to use internally in the gateway in Windows.
[-i]
Option to use the Channel IRT function in TCPGWTHR. If it is configured as COUSIN, and there is no remote server connected to TCPGWTHR, the request is sent to another TCPGWTHR with an available connection.
[-f]
When run in the dedicated mode, only one connection per IP is allowed by default. When a new connection is requested from the already connected IP, the existing connection is disconnected and the new connection request is also cancelled. If this option is used, the existing connection is disconnected but the new connection request is processed and used for communication.
-
Clishm Option
The following table describes the Clishm option.
Option Description [-F]
Option to run in the dedicated mode. Enter a full path for the gateway environment file path. For information on how to register the file, refer to TCPGWTHR Environment File.
[-k]
Shared memory key used for sharing information within the gateway. Uses the entered key and key +1.
[-N]
Number of handler processes. If the MIN value of the handler process is used, the handler process' MIN and MAX must be set to the same value.
[-w]
Port number used internally in the gateway for Windows.
3. TCPGWTHR 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 remote node address and server ID.
3.1. Address Information File
The address information file is configured as follows, depending on whether it is in client or server mode.
-
Client Mode
Configure as follows to connect to multiple servers in the client mode.
####################################################### # TCP/IP Thread Gateway Config # ####################################################### # Server IP Server Port Server ID # 1.1.1.1 9000 SERVER1 ####################################################### # line start with "#" is comment line ####################################################### 61.33.32.123 9000 SERVER1 61.33.32.124 9100 SERVER2
The following is an example in the IPv6 protocol environment.
Configure the IPv4 and IPv6 addresses as follows.
# Server IP Server Port Server ID 2011::100:100 9000 SERVER1 2011::100:200 9100 SERVER2 61.33.32.123 9200 SERVER3 61.33.32.124 9300 SERVER4
The following table describes the items of the address information file.
Item Description Server IP
IP address of the remote node.
Server Port
Port number of the remote node.
Server ID
ID required for selecting a channel in the dedicate method when calling a gateway service from a Tmax service. Maximum length is 31 characters.
-
Server Mode
Use the following configuration to connect using the dedicate method in the server mode.
####################################################### # TCP/IP Thread Gateway Config # ####################################################### # Client IP Server Port Client ID # 1.1.1.1 9000 CLIENT1 ####################################################### # line start with "#" is comment line ####################################################### 61.33.32.123 9000 CLIENT1 61.33.32.124 9100 CLIENT2
Either IPv4 or IPv6 method can be configured based on the '-X SERVER_IPV6' configuration of the listener. If the listener is using the IPv6 protocol, all client addresses must be created in the IPv6 format.
# Client IP Server Port Client ID 2011::100:100 9000 CLIENT1 2011::100:200 9100 CLIENT2 2011::100:300 9200 CLIENT3 2011::100:400 9300 CLIENT4