TipcSrvConnGmdMsgDelete


Name

TipcSrvConnGmdMsgDelete — delete a message from the GMD area after a GMD failure

Synopsis

T_BOOL TipcSrvConnGmdMsgDelete(srv, msg) 
T_IPC_SRV srv; 
T_IPC_MSG msg; 

Arguments

srv — connection handle to RTserver

msg — message to delete

Return Values

TRUE if the guaranteed message was successfully deleted from the GMD area of the connection to RTserver, FALSE otherwise.

Diagnostics

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

Description

TipcSrvConnGmdMsgDelete deletes a message after a GMD failure on the connection to RTserver by calling TipcConnGmdMsgDelete. TipcSrvConnGmdMsgDelete 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 TipcSrvConnGmdMsgDelete 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.

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

Caution

Use TipcSrvConnGmdMsgDelete only from a GMD_FAILURE process callback.

See Also

TipcCbConnProcessGmdFailure, TipcCbSrvProcessGmdFailure, TipcConnGmdMsgDelete, TipcSrvConnGmdMsgStatus

Examples

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 it does not 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; 
{ 
  T_IPC_MSG failed_msg; 
T_IPC_SRV srv = arg; 
 
  /* 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 (!TipcSrvConnGmdMsgDelete(srv, 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 (TipcSrvConnProcessCbCreate(srv, mt, my_gmd_failure_cb, srv) 
    == NULL) { 
  return;  /* error */ 
} 
 
/* destroy standard callback for GMD_FAILURE messages */ 
cb = TipcSrvConnProcessCbLookup(srv, 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