In DataGate for IBM i v16, DataGate’s internal inter-process communication (IPC) uses a revamped implementation to take advantage of modern IBM i sockets facilities. This eliminates potential complications caused by the old *USRQ-based implementation. For example, some customers reported “thousands” of *USRQ objects in their installation libraries, apparently left behind by crashing or abruptly ended user jobs.

The new scheme uses the IBM i's system sockets facility, similar to the TCP/IP sockets, to connect DG clients and servers.  The IPC sockets used by DG/400 are in the class of “Unix” sockets.  Unix sockets are based on operating system internal communications mechanisms, but use the Unix file system as an “address” mechanism.  Basically, a “listener” process (job) creates a Unix socket file somewhere in the file system; perhaps a “well-known” file path, such as “/tmp”.  Other processes (jobs) can communicate with the listener by specifying the listener’s socket path to create a connecting socket. 

Prior to DataGate for IBM i v16, DataGate stored sockets files in the "/tmp" directory of the IBM i's Integrated File System (IFS). Using the "/tmp" directory has proved troublesome for some customers. Starting with DataGate v16.0.31.0, you can specify an IFS custom directory for the sockets files. This article explains how to do that.

A pending version of DataGate v16 will automatically create and use a special "/ASNA/run" directory for these files. Until that version is released, you need to manually create a custom IFS directory for the sockets files.

To create a special IFS directory for DataGate 16.0.31.0 socket files:

Note: These instructions are for DataGate for IBM i version 16.0.31.0 only. If you aren't using that version you'll need to upgrade to get the ability to change the sockets folder.

Use the AddEnvVar command to add a system-level environment variable named DG_TMPDIR that specifies the path in the IFS you want DataGate to use for its socket files. Every directory in the path except the last needs *RX permission. The last directory needs *RWX permission.

For this example, let's assume you want DataGate to use the run directory under the ASNAdirectory for its socket files:

/DataGate/run

Note: do not use "/DataGate/run" as your custom sockets directory. Doing so will later disrupt a DataGate upgrade. 

Step 1. After you're sure there aren't any active DG end-user jobs, end DataGate.

Step 2. Add the DG_TMPDIR environment variable with the value of '/DataGate/run' (Be sure to make this a system-level value (*SYS)):

CHGENVVAR ENVVAR(DG_TMPDIR) VALUE('/ASNA/run') LEVEL(*SYS)


Step 3. Create the ASNA and run directories in the IFS:

CRTDIR DIR('/DataGate') DTAAUT(*RX) OBJAUT(*NONE)
CRTDIR DIR('/DateGate/run') DTAAUT(*RWX) OBJAUT(*NONE) 


Step 4. Restart DataGate for these changes to take effect.

Helpful links: