RTserver and RTclient allow many processes to communicate easily with each other. 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 on page 20.
The functions TipcSrvCreate, TipcSrvDestroy, and TipcSrvGetConnStatus manipulate the status of the connection to RTserver. These functions use 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. These functions use 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. This is how the traversal function is defined:
In addition to connection callbacks, an RTclient process can have server create callbacks, server destroy callbacks, server names traverse callbacks, and subject callbacks. (See Connection Callbacks on page 14 for information on connection 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_ENTRY (*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_ENTRY (*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 traverse callback data structures are defined:
typedef void (T_ENTRY1 * T_ENTRY2 T_EXPORT T_IPC_SRV_TRAVERSE_CB_FUNC) T_TYPEDEF((T_IPC_CONN,/* conn */
T_IPC_SRV_TRAVERSE_CB_DATA,/* data */
T_CB_ARG));/* arg */
typedef struct T_IPC_SRV_TRAVERSE_CB_DATA_STRUCT T_IPC_SRV_TRAVERSE_CB_DATA_STRUCT, *T_IPC_SRV_TRAVERSE_CB_DATA; struct T_IPC_SRV_TRAVERSE_CB_DATA_STRUCT { T_CB cb; T_STR server_name;/* next server name in the list */
T_BOOL stop_traverse;/* set by callback to stop traversing */
};
This is how the server subject callback data structures are defined:
typedef void T_ENTRY (*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™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |