RTserver routes publish-subscribe messages to RTclient processes through local and global connections. RTserver and RTclient are discussed in detail in the TIBCO SmartSockets User’s Guide. Most RTclient applications require only a single connection to an RTserver. This single global connection is created and managed using the TipcSrv API. RTclient applications that require multiple connections to RTservers use the TipcSrvConn API, covered in Multiple Connections.
The functions TipcSrvCreate, TipcSrvDestroy, and TipcSrvGetConnStatus manipulate the status of the connection to RTserver using an enumerated type. This is how the enumerated type is defined:
typedef enum { T_IPC_SRV_CONN_NONE,/* not connected at all */
T_IPC_SRV_CONN_WARM,/* warm connection to RTserver */
T_IPC_SRV_CONN_FULL/* fully connected to RTserver */
} T_IPC_SRV_CONN_STATUS;
The functions TipcSrvLogAddMt and TipcSrvLogRemoveMt add a message type to or remove a message type from a message file logging type, using an enumerated type. This is how the enumerated type is defined:
typedef enum { T_IPC_SRV_LOG_DATA,/* slot values and time */
T_IPC_SRV_LOG_STATUS,/* status messages */
T_IPC_SRV_LOG_INTERNAL/* all other standard message types */
} T_IPC_SRV_LOG_TYPE;
The function TipcSrvStop stops RTserver and possibly more processes, using an enumerated type. This is how the enumerated type is defined:
typedef enum { T_IPC_SRV_STOP_NORMAL = 1,/* just stop one RTserver */
T_IPC_SRV_STOP_ALL,/* stop all RTservers and RTclients */
T_IPC_SRV_STOP_CLIENTS,/* stop one RTserver and its RTclients */
T_IPC_SRV_STOP_SERVERS/* stop all RTservers */
} T_IPC_SRV_STOP_TYPE;
The function TipcSrvSubjectTraverseSubscribe can be used to traverse the subjects that an RTclient process is subscribing to, using a traversal function. This is how the traversal function is defined:
An RTclient process can have server create callbacks and server destroy callbacks. Each callback type has a callback function type and callback data type.
This is how the server create callback data structures are defined:
typedef void (*T_IPC_SRV_CREATE_CB_FUNC) (T_IPC_CONN conn, T_IPC_SRV_CREATE_CB_DATA data, T_CB_ARG arg); typedef struct T_IPC_SRV_CREATE_CB_DATA_STRUCT T_IPC_SRV_CREATE_CB_DATA_STRUCT, *T_IPC_SRV_CREATE_CB_DATA; struct T_IPC_SRV_CREATE_CB_DATA_STRUCT { T_CB cb; T_IPC_SRV_CONN_STATUS old_conn_status;/* old connection status */
T_IPC_SRV_CONN_STATUS new_conn_status;/* new connection status */
};
This is how the server destroy callback data structures are defined:
typedef void (*T_IPC_SRV_DESTROY_CB_FUNC) (T_IPC_CONN conn, T_IPC_SRV_DESTROY_CB_DATA data, T_CB_ARG arg); typedef struct T_IPC_SRV_DESTROY_CB_DATA_STRUCT T_IPC_SRV_DESTROY_CB_DATA_STRUCT, *T_IPC_SRV_DESTROY_CB_DATA; struct T_IPC_SRV_DESTROY_CB_DATA_STRUCT { T_CB cb; T_IPC_SRV_CONN_STATUS old_conn_status;/* old connection status */
T_IPC_SRV_CONN_STATUS new_conn_status;/* new connection status */
};
This is how the server subject callback data structures are defined:
typedef void (*T_IPC_CONN_MSG_CB_FUNC) (T_IPC_CONN conn, T_IPC_CONN_MSG_CB_DATA data, T_CB_ARG arg); typedef T_IPC_CONN_MSG_CB_FUNC T_IPC_SRV_SUBJECT_CB_FUNC; struct T_IPC_CONN_MSG_CB_DATA_STRUCT { T_CB cb; T_IPC_MSG msg; }; typedef T_IPC_CONN_MSG_CB_DATA_STRUCT T_IPC_SRV_SUBJECT_CB_DATA_STRUCT, *T_IPC_SRV_SUBJECT_CB_DATA;
TIBCO SmartSockets™ API Quick Reference Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |