TipcSrvConnGmdFileCreate


Name

TipcSrvConnGmdFileCreate — create guaranteed message delivery area on the connection

Synopsis

T_BOOL TipcSrvConnGmdFileCreate(srv) 
T_IPC_SRV srv; 

Arguments

srv — connection handle to RTserver

Return Values

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

Diagnostics

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

Description

TipcSrvConnGmdFileCreate 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.

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

Caution

TipcSrvConnOpen calls TipcSrvConnGmdResend to automatically resend old GMD messages, and TipcSrvConnGmdResend calls TipcSrvConnGmdFileCreate if old GMD files exist.

The most common cause of TipcSrvConnGmdFileCreate 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, TipcSrvConnGmdFileDelete

Examples

This example calls TipcSrvConnGmdFileCreate 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_SRV srv; 
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 
TipcSrvConnGmdFileCreate may call TipcSrvConnCreate which calls TipcSrvConnGmdResend 
which calls TipcSrvConnGmdFileCreate, so the first call can fail with error number 
T_ERR_ALREADY_EXISTS. */ 
if (!TipcSrvConnGmdFileCreate(srv) 
    && TutErrNumGet() != T_ERR_ALREADY_EXISTS) { 
  return;  /* error */ 
} 
 
mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); 
if (mt == NULL) { 
  return;  /* error */ 
}  
 
if (!TipcSrvConnMsgWrite(srv, "/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