TipcConnGmdMsgDelete delete a message from GMD area after a GMD failure on a connection
conn
connection from whose GMD area the message is to be deleted
msg
message to delete
TRUE
if the guaranteed message was successfully deleted from the GMD area of the connection, FALSE
otherwise.
If TipcConnGmdMsgDelete fails, it returns FALSE
and sets the global SmartSockets error number to one of:
conn
was null or msg
was nullmsg
was not a valid messagemsg
could not be found in the GMD area for conn
TipcConnGmdMsgDelete deletes a message after a GMD failure on a connection. TipcConnGmdMsgDelete is intended to be used from a GMD_FAILURE connection process callback to terminate GMD for the message.
When a GMD_FAILURE message is processed by a sender, one of two scenarios is possible:
The standard callback TipcCbConnProcessGmdFailure uses TipcConnGmdMsgDelete to delete failed messages. See TipcCbConnProcessGmdFailure and TipcCbSrvProcessGmdFailure for more information on processing GMD_FAILURE messages.
TipcConnGmdMsgDelete should only be used from a GMD_FAILURE process callback.
The T_ENTRY declaration specifier is required in the definition of all callback functions as well as their prototypes.
TipcCbConnProcessGmdFailure, TipcCbSrvProcessGmdFailure, TipcConnGmdMsgResend, TipcSrvGmdMsgDelete
This example creates a connection process callback for GMD_FAILURE messages which silently deletes the message that failed (this callback is essentially a silent version of TipcCbConnProcessGmdFailure). The existing callback TipcCbConnProcessGmdFailure is destroyed to avoid interfering with the new callback:
void T_ENTRY my_gmd_failure_cb(conn, data, arg) T_IPC_CONN conn; T_IPC_CONN_PROCESS_CB_DATA data; T_CB_ARG arg;/* not used */
{ T_IPC_MSG failed_msg;/* go to the first field of the GMD_FAILURE message */
if (!TipcMsgSetCurrent(data->msg, 0)) {return
; /* error */
}/* read the first field of the GMD_FAILURE message, which is */
/* the message where GMD failed */
if (!TipcMsgNextMsg(data->msg, &failed_msg))return
; /* error */
}/* terminate the sender’s knowledge about the message for GMD */
if (!TipcConnGmdMsgDelete(conn, failed_msg)) {return
; /* error */
} }/* my_gmd_failure_cb */
/* =========================================================== */
/*...code from calling function is below */
T_IPC_MT mt; T_CB cb; mt = TipcMtLookupByNum(T_MT_GMD_FAILURE); if (mt == NULL) {return
; /* error */
}/* create connection process callback for GMD_FAILURE messages */
if (TipcConnProcessCbCreate(conn, mt, my_gmd_failure_cb, NULL) == NULL) {return
; /* error */
}/* destroy standard callback for GMD_FAILURE messages */
cb = TipcConnProcessCbLookup(conn, mt, TipcCbConnProcessGmdFailure, NULL); if (cb == NULL) {return
; /* error */
} if (!TutCbDestroy(cb)) {return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |