TipcSrvGmdMsgDelete delete a message from GMD area after a GMD failure on the connection to RTserver
msg
message to delete
TRUE
if the guaranteed message was successfully deleted from the GMD area of the connection to RTserver, FALSE
otherwise.
If TipcSrvGmdMsgDelete fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcSrvGmdMsgDelete deletes a message after a GMD failure on the connection to RTserver by calling TipcConnGmdMsgDelete. TipcSrvGmdMsgDelete is intended to be used from a GMD_FAILURE connection process callback to terminate GMD for the message. See TipcConnGmdMsgDelete for more information on deleting messages when GMD failures occur.
When a GMD_FAILURE message is processed by a sender RTclient, one of two scenarios is possible:
The standard callback TipcCbConnProcessGmdFailure uses TipcConnGmdMsgDelete to delete failed messages. Use TipcSrvGmdMsgDelete instead of TipcConnGmdMsgDelete in user-defined callbacks for processing GMD_FAILURE messages on the connection to RTserver. See TipcCbConnProcessGmdFailure and TipcCbSrvProcessGmdFailure for more information on processing GMD_FAILURE messages.
TipcSrvGmdMsgDelete may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvGmdMsgDelete deletes the message from the GMD area for the warm connection. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.
Use TipcSrvGmdMsgDelete only from a GMD_FAILURE process callback.
TipcCbConnProcessGmdFailure, TipcCbSrvProcessGmdFailure, TipcConnGmdMsgDelete, TipcSrvGmdMsgStatus
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 so as not to interfere 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 (!TipcSrvGmdMsgDelete(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 (TipcSrvProcessCbCreate(mt, my_gmd_failure_cb, NULL) == NULL) {return
; /* error */
}/* destroy standard callback for GMD_FAILURE messages */
cb = TipcSrvProcessCbLookup(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 |