Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP ToolTalk Programmer's Guide > Chapter 6 Participating in ToolTalk Sessions

Registering in a Specified Session

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Glossary

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, :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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.