ToolTalk User's Guide

Registering in a Specified Session

To register in a session other than the initial session, your program must find the name of the other session, set the new session as the default, and register with the ToolTalk service.

The following code sample shows how to join an X session named somehost:0 that is not your initial session.

char   *my_session;
char   *my_procid;

my_session = tt_X_session(“somehost:0”);
tt_default_session_set(my_session);
my_procid = tt_open();
ttfd = tt_fd();


Note –

The required calls must be in the specified order.


  1. tt_X_session();

    This call retrieves the name of the session associated with an X display server. tt_X_session() takes the argument char *xdisplay_name

    where xdisplay_name is the name of an X display server (in this example, somehost:0).

  2. tt_default_session_set();

    This call sets the new session as the default session.

  3. tt_open();

    This call returns the procid for your process and sets it as the default procid.

  4. tt_fd();

    This call returns a file descriptor for your current procid.