When a message is scoped to a file, only those applications that have joined the file (and match the remaining attributes) will receive the message. Applications that share interest in a file do not have to be running in the same session.
Table 8-2 describes the types of scopes that use files which you can use to scope messages with patterns.
Table 8-2 Scoping a Message with Patterns to a File
Type of Scope |
Description |
---|---|
|
Scopes to the specified file only. You can set a session attribute on this type of pattern to provide a file-in-session-like scoping but a tt_session_join call will not update the session attribute of a pattern that
is scoped to |
|
Scopes to the union of interest in the file and the session. A pattern with only this scope will match messages that are scoped to the file, or scoped to the session, or scoped to both the file and the session. |
|
Scopes to the intersection of interest in the file and the session. A pattern with only this scope will only match messages that are scoped to both the file and session. |
To scope to the union of TT_FILE_IN_SESSION
and TT_SESSION
, add both scopes to the same pattern, as shown in Example 8-1.
TT_FILE_IN_SESSION
and TT_SESSION
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
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.