TipcSrvDefaultCbCreate


Name

TipcSrvDefaultCbCreate — create a default callback in the connection to RTserver

Synopsis

T_CB TipcSrvDefaultCbCreate(func, arg) 
T_IPC_CONN_DEFAULT_CB_FUNC func; 
T_CB_ARG arg; 

Arguments

func — callback function

arg — user-defined argument to pass to func

Return Values

New callback if successful, NULL otherwise.

Diagnostics

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

Description

TipcSrvDefaultCbCreate creates a default callback in the connection to RTserver by calling TipcConnDefaultCbCreate. These callbacks are called by TipcSrvMsgProcess when there are no process callbacks for the type of message being processed. See TipcConnDefaultCbCreate for more information on default callbacks.

TipcSrvDefaultCbCreate may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvDefaultCbCreate creates a default callback in the warm connection. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.

Caution

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

See Also

TipcConnDefaultCbCreate, TipcSrvMsgProcess, TipcSrvDefaultCbLookup

Examples

This example creates a default callback which warns that an unexpected message has arrived from the connection to RTserver:

void T_ENTRY my_srv_default_cb(conn, data, arg) 
T_IPC_CONN conn; /* connection to RTserver */ 
T_IPC_CONN_DEFAULT_CB_DATA data; 
T_CB_ARG arg; /* not used */ 
{ 
  if (!TipcMsgPrintError(data->msg)) { 
    return;  /* error */ 
  }  
} /* my_srv_default_cb */ 
 
/* =========================================================== */ 
/*...code from calling function is shown below */ 
 
/* create default callback */ 
if (TipcSrvDefaultCbCreate(my_srv_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