TipcConnDefaultCbCreate


Name

TipcConnDefaultCbCreate — create a default callback in a connection

Synopsis

T_CB TipcConnDefaultCbCreate(conn, func, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_DEFAULT_CB_FUNC func; 
T_CB_ARG arg; 

Arguments

conn — connection for which to create callback

func — callback function

arg — user-defined argument to pass to func

Return Values

New callback if successful, NULL otherwise.

Diagnostics

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

Description

TipcConnDefaultCbCreate creates a default callback in a connection. These callbacks are called by TipcConnMsgProcess when there are no process callbacks for the type of message being processed. Default callbacks are useful for processing unexpected message types or for generic processing of most message types.

See TipcConnMsgProcess for more information on the relationship between process callbacks and default callbacks.

Caution

The T_ENTRY declaration specifier is required in the definition of all callback functions as well as their prototypes.

See Also

TipcConnMsgProcess, TipcConnDefaultCbLookup; see the TIBCO SmartSockets Utilities for information on TutCbDestroy.

Examples

This example creates a default callback which warns that an unexpected message has arrived:

void T_ENTRY my_conn_default_cb(conn, data, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_DEFAULT_CB_DATA data; 
T_CB_ARG arg; /* not used */ 
{ 
  if (!TipcMsgPrintError(data->msg)) { 
    return;  /* error */ 
  }  
} /* my_conn_default_cb */ 
 
/* =========================================================== */ 
/*...code from calling function is below */ 
 
/* create default callback */ 
if (TipcConnDefaultCbCreate(conn, my_conn_default_cb, NULL) == 
NULL) { 
  return;  /* error */ 
}  

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com