X3270PORT environment variable

From The x3270 Wiki

The X3270PORT environment variable contains a TCP port number used by a script to pass actions to the emulator. Scripts are run by the Script() action. The emulator listens to that port on the IPv4 loopback address, 127.0.0.1. The script uses the s3270 protocol to communicate with the emulator.

Examples

The port is a randomly-chosen ephemeral port number.

12345