TipcEventCreateMsg create a message event that is invoked based on a message’s subject
T_IPC_EVENT TipcEventCreatMsg(dispatcher
,srv
,subject
,event_func
,event_arg
) T_IPC_DISPATCHERdispatcher
; T_IPC_SRVsrv
; T_STRsubject
; T_IPC_EVENT_FUNCevent_func
; T_PTRevent_arg
;
dispatcher
the dispatcher on which to invoke the event
srv
an RTserver connection to wait for messages on
subject
the subject that triggers the event
event_func
the function to be invoked
event_arg
an optional argument to pass to the event_func
A new event if successful, NULL
otherwise.
If TipcEventCreateMsg fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcEventCreateMsg creates a message event of type T_IPC_EVENT_MSG to be invoked when a message arrives on the srv
connection whose destination matches subject
.
The message must not be destroyed from within the event’s callback function. SmartSockets manages the message and automatically destroys the message once all events are dispatched. If you need to keep a copy of the message, call TipcMsgClone.
TipcEventGetType, TipcEventCreateMsgType
This example creates a message event that is triggered by a message’s subject:
void T_ENTRY msgFunc(T_IPC_EVENT event, T_IPC_EVENT_DATA data, T_PTR arg) { TipcMsgPrint(data->msg, TutOut); }/* =========================================================== */
/*...code from main program is below */
msg_event = TipcEventCreateMsg(dispatcher, srv, "/stocks", msgFunc, T_NULL); if (msg_event == NULL) {
return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |