TipcSrvGmdFileCreate


Name

TipcSrvGmdFileCreate — create guaranteed message delivery area on the connection to RTserver

Synopsis

T_BOOL TipcSrvGmdFileCreate() 

Arguments

None

Return Values

TRUE if the GMD area was successfully created for the connection to RTserver, FALSE otherwise.

Diagnostics

If TipcSrvGmdFileCreate fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcSrvGmdFileCreate creates a GMD area on the connection to RTserver by calling TipcConnGmdFileCreate. A GMD area holds guaranteed message delivery information for both incoming and outgoing messages. There are two types of guaranteed message delivery: file-based GMD and memory-only GMD. See TipcConnGmdFileCreate for more information on GMD areas.

The full pathnames of the GMD files for the connection to RTserver are simpler than those for other connections. The full pathnames are built from the value from TipcGetGmdDir plus rtserver. For example, an RTclient process with the unique subject unique_subject would use the full pathname:

UNIX
/tmp/rtworks/gmd/unique_subject/rtserver.hsn 
OpenVMS
dka300:[ssuser.gmd.unique_subject]rtserver.hsn 
Windows
c:\temp\rtworks\gmd\unique_subject\rtserver.hsn 

Because the connection to RTserver has a fixed purpose, it can use shorter file names than other generic connections.

TipcSrvGmdFileCreate may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvGmdFileCreate creates the GMD area for the warm connection. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.

Caution

TipcSrvCreate calls TipcSrvGmdResend to automatically resend old GMD messages, and TipcSrvGmdResend calls TipcSrvGmdFileCreate if old GMD files exist.

The most common cause of TipcSrvGmdFileCreate switching to memory-only GMD is not setting the option Unique_Subject to a value other than the default _Node_Pid. Each process that uses file-based GMD must properly configure Unique_Subject.

See Also

TipcConnGmdFileCreate, TipcSrvGmdFileDelete

Examples

This example calls TipcSrvGmdFileCreate to explicitly create the GMD area for the connection to RTserver, and then sends a NUMERIC_DATA message with guaranteed delivery to the test subject through RTserver:

T_IPC_MT mt; 
T_IPC_MSG msg; 
 
/* have to set the Unique_Subject option to use file-based GMD */ 
TutCommandParseStr("setopt unique_subject /example/sender"); 
 
/* Explicitly create GMD area to allow full control over error handling. This is slightly tricky since 
TipcSrvGmdFileCreate may call TipcSrvCreate which calls TipcSrvGmdResend which calls 
TipcSrvGmdFileCreate, so the first call can fail with error number T_ERR_ALREADY_EXISTS. */ 
if (!TipcSrvGmdFileCreate() 
    && TutErrNumGet() != T_ERR_ALREADY_EXISTS) { 
  return;  /* error */ 
} 
 
mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); 
if (mt == NULL) { 
  return;  /* error */ 
}  
 
if (!TipcSrvMsgWrite("/system/test", mt, FALSE, 
                     T_IPC_PROP_DELIVERY_MODE, T_IPC_DELIVERY_ALL, 
                     T_IPC_FT_STR, "test_value", 
                     T_IPC_FT_REAL8, 10.0, 
                     NULL)) { 
  return;  /* error */ 
} 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com