ToolTalk User's Guide

Joining the Default Session

When you join a session, the ToolTalk service updates your message pattern with the sessid. For example, if you have declared a ptype or registered a message pattern that specifies TT_SESSION or TT_FILE_IN_SESSION, use tt_session_join to join the default session. The following code sample shows how to join the default session.

	/*
	 * Join the default session
	 */

	tt_session_join(tt_default_session());

Table 9–2 lists the ToolTalk functions you use to join the session in which you are interested.

Table 9–2 ToolTalk Functions for Joining Default Sessions

Return Type 

ToolTalk Function 

Description 

char *

tt_default_session(void)

Return default session id 

Tt_status

tt_default_session_set(const char *sessid)

Set default session 

char *

tt_initial_session(void)

Return initial session id 

Tt_status

tt_session_join(const char *sessid)

Join this session  

Tt_status

tt_session_quit(const char *sessid)

Quit session 

Once your patterns are updated, you will begin to receive messages scoped to the session you joined.


Note –

If you had previously joined a session and then registered a ptype or a new message pattern, you must again join the same session or a new session to update your pattern before you will receive messages that match your new pattern.


When you no longer want to receive messages that reference the default session, use the tt_session_quit() function. This function removes the sessid from your session-scoped message patterns.