TipcConnGmdResend resend all guaranteed messages after a delivery failure on a connection
conn
connection to resend messages on
TRUE
if the guaranteed messages were successfully resent on the connection, FALSE
otherwise.
If TipcConnGmdResend fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcConnGmdResend resends guaranteed messages after a delivery failure on a connection. TipcConnGmdResend reads all the messages from the GMD area and calls TipcConnMsgSend for each one to resend. The receiving processes automatically detect any redundant messages they have already processed. See TipcConnGmdFileCreate for more information on GMD areas.
When a process using GMD creates a connection, one of two scenarios is possible:
If the connection does not have a GMD area open and there are existing GMD files on disk then TipcConnGmdResend calls TipcConnGmdFileCreate to open the existing GMD files.
TipcConnGmdResend should only be used when a connection is first created.
TipcConnGmdResend resends all messages with GMD, but does not explicitly flush the messages. See TipcConnGetAutoFlushSize for more information on message buffering.
This example creates a client connection to a server process, calls TipcConnGmdResend to resend any existing GMD files for the connection, 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 */
}/* Resend any previously sent messages with GMD. Use TipcConnGmdFileDelete instead of TipcConnGmdResend here if you wish to delete the existing GMD files instead of resending any previously sent GMD messages. */
if (!TipcConnGmdResend(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 |