TipcConnGmdFileDelete delete guaranteed message delivery files for a connection
conn
connection for which to remove GMD files
TRUE
if the connection GMD files were successfully deleted from disk, FALSE
otherwise.
If TipcConnGmdFileDelete fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcConnGmdFileDelete deletes from disk guaranteed message delivery (GMD) files for a connection. TipcConnGmdFileDelete is useful for processes that wish to completely delete any obsolete GMD information. See TipcConnGmdFileCreate for more information on GMD areas.
When a process using GMD creates a connection, one of two scenarios is possible:
TipcConnGmdFileDelete should be used carefully, as deleting GMD files removes all record of old messages that were supposed to be delivered.
Old GMD files must be removed before any messages with guaranteed delivery are sent or received on the connection. TipcConnGmdFileDelete does not delete the GMD files if they are already open by this process and in use for the connection. The GMD files are opened by TipcConnGmdFileCreate.
TipcConnGmdFileCreate, TipcSrvGmdFileDelete
This example creates a client connection to a server process, calls TipcConnGmdFileDelete to remove any existing GMD files for the connection, and then sends a NUMERIC_DATA message with guaranteed delivery to the server process:
T_IPC_CONN conn; 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_client"); conn = TipcConnCreateClient("tcp:_node:4242"); if (conn == NULL) {
return
; /* error */
}/* Clear out old GMD files before sending/receiving any messages. Use TipcConnGmdResend instead of TipcConnGmdFileDelete here if you wish to resend any previously sent messages with GMD. */
if (!TipcConnGmdFileDelete(conn)) {
return
; /* error */
} mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); if (mt == NULL) {
return
; /* error */
} if (!TipcConnMsgWrite(conn, mt, 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 |