ToolTalk User's Guide

How does tt_open connect to a ttsession?

After some internal initialization, tt_open tries to find a ttsession.

  1. tt_open checks whether the environment variable TT_SESSION is set.

    If this environment variable is set, it uses the value as the id of the ttsession.

    If this environment variable is not set, it checks to see if the DISPLAY environment variable is set.

    • If this environment variable is set, it uses the value as the id of the ttsession.

    • If this environment variable is not set, it checks to see if the TT_SESSION property on root X window (of the machine running the display) is set.

    In the event that none of these environment variables are set, it will start a ttsession itself.

  2. tt_open 'pings' the ttsession to make sure it is active.

  3. tt_open checks the environment variable TT_TOKEN to determine whether the client was started from a `start' command for the ptype.

    Once the start ptype is determined, tt creates a procid.

  4. tt_open creates a TCP/IP socket on the client side to which ttsession connects.

    Activity on the socket is noticed via the socket's associated file descriptor. ttsession only uses this channel to notify the client of incoming messages.


Note -

Call tt_close on this file descriptor; do not call the close function. If you call the close function on the file descriptors returned by tt_fd, your file descriptor count will rise upon successive tt_open and close calls.


  1. tt_open refreshes the database hostname redirection map.