ToolTalk User's Guide

File-based Scoping in Messages

Messages have the same types of file-based scoping mechanisms as patterns. Table 8-3 describes these scopes.

Table 8-3 Scoping Mechanisms for Messages

Type of Scope 

Description 

TT_FILE

Scopes the message to all clients that have registered interest in a file.  

TT_BOTH

Scopes the message to all clients that have registered interest in the message's session, the message's file, or the message's session and file.  

TT_FILE_IN_SESSION

Scopes the message to all clients that have registered interest in both the message's file and session.  

TT_SESSION + tt_message_file_set()

Scopes the message to every client that has registered interest in the message's session. When the message is received by a client whose pattern matches, the receiving client can call tt_message_file to get the file name.

When a message is scoped to TT_FILE or TT_BOTH, the ToolTalk client library checks the database server for all sessions that have clients that are interested in the file and sends the message to all of the interested ToolTalk sessions. The ToolTalk sessions then match the messages to the appropriate clients. The message sender is not required to explicitly call to tt_file_join.

If a message that is scoped to TT_FILE_IN_SESSION or TT_SESSION contains a file, the database server is not contacted and the message is sent only to clients that are scoped to the message's session.