If you want to use the default configuration for GMD, there is little configuration required. File-based GMD, rather than memory-only GMD, is the recommended way to use GMD because of its ability to recover from process failures. The main configuration required for file-based GMD is to set the option Unique_Subject to a value other than the default, to a unique and consistent name that no other process on the node is using.
To configure GMD, you set the GMD-related options using the setopt
command. Many of these options are not required unless you want to use a value other than the default setting. The GMD options for peer-to-peer connections are the same as the GMD options for RTclients. For more detailed information about the options, see Chapter 8, Options Reference.
Here are the options you can set to change your GMD configuration:
default
If Ipc_Gmd_Type is set to memory
, memory-based GMD occurs even if you set a value for Unique_Subject. However, if you did not set a value for Unique_Subject, memory-based GMD is used even if Ipc_Gmd_Type is set to default
.
default
, SmartSockets attempts file-based GMD, but sometimes must revert to memory-based GMD. See Reverting to Memory-Based GMD._Node_Pid
, where Node
is the network node name of the computer on which the process is running, and Pid
is the operating system process identifier of the process. The default _Node_Pid
usually changes if the program is restarted, because of the new value for Pid
. This prevents the restarted program from finding the old GMD files, and is why Unique_Subject must be explicitly set to use file-based GMD.For RTclient and RTserver processes, the option Unique_Subject must be set to an RTserver group-wide unique name. Keep in mind that for connection programs, Unique_Subject does not really specify a subject, only a unique name for GMD.
For example:
When Unique_Subject is set, and Ipc_Gmd_Type is default
, SmartSockets attempts file-based GMD. If file-based GMD cannot be carried out, SmartSockets reverts to memory-based GMD for the message. Generally, when SmartSockets reverts from file-based to memory-based GMD, it is because the file-based GMD area could not be written to, for example, due to a permissions problem.
If file-based GMD cannot be used, a warning is issued and the process switches to memory-only GMD. For example:
WARNING: Could not create GMD file(s) with base name <tcp__node_5252_conngmdc> for connection <server:tcp:_node:5252:1>. The option Unique_Subject must be set to a value other than the default (_himalia.talarian.com_10783). WARNING: Switching to memory-only GMD.
To check if a process is properly configured for file-based GMD, use the function TipcGetGmdDir. For example:
TipcGetGmdDir attempts to create the needed directories if they do not exist.
When a process creates a connection, the process may not want to use the file-based GMD information from a previous connection with the same GMD configuration. Some applications, for example, may want to have the concept of a complete restart where all old GMD information is purged. The function TipcConnGmdFileDelete can be used to delete the old GMD files. For example:
When a process using GMD creates a client connection with TipcConnCreateClient or accepts a connection from a client with TipcConnAccept, it typically does one of two things:
Before any messages can be sent or received with GMD, a GMD area must be created with the function TipcConnGmdFileCreate. For example:
If the GMD area files already exist on disk, TipcConnGmdFileCreate reads in the contents of the old GMD area. The functions TipcConnRead and TipcConnMsgSend automatically call TipcConnGmdFileCreate to create a GMD area for a connection that needs one. For example, the server example program conngmds.c
does not explicitly call TipcConnGmdFileCreate, but instead lets TipcConnMainLoop, which eventually calls TipcConnRead, take care of it. For most applications, both ways are equivalent.
File-based GMD places all files it creates under the directory specified in the option Ipc_Gmd_Directory, which defaults to these locations:
The directory specified in Ipc_Gmd_Directory should be on a local file system for best performance. File-based GMD also uses Unique_Subject to generate pathnames for the GMD area. See the reference page for TipcConnGmdFileCreate in the TIBCO SmartSockets Application Programming Interface reference for full details on GMD area pathnames.
The resources used by GMD can be constrained by storage used, by elapsed time, or by both.
A connection GMD area uses disk files or memory to store the information needed for GMD. A GMD area has a maximum size (in bytes) that can be used to limit the amount of disk space or memory that a GMD area can use. The default connection GMD area maximum size is 0
, which means that no maximum size limit checking is performed. Use the TipcConnGetGmdMaxSize function to get the GMD area maximum size. For example:
The function TipcConnSetGmdMaxSize is used to set the GMD area maximum size. For example:
If the connection GMD area maximum size is exceeded, then no further messages can be sent with GMD until some unacknowledged, previously-sent messages are acknowledged. This is one of the few synchronous notifications of a GMD-related failure, compared to the asynchronous GMD_FAILURE messages.
The connection delivery timeout property can be used to limit the amount of time that GMD has to deliver each message. This can be useful for real-time applications that need to be notified if a certain action does not take place within a certain period of time. If a different timeout is required for an individual message, the message’s delivery timeout property can instead be set directly.
TIBCO SmartSockets™ User’s Guide Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |