TipcEventCreateMsgType create a message event that is invoked based on a message’s type
T_IPC_EVENT TipcEventCreatMsgType(dispatcher
,srv
,mt
,event_func
,event_arg
) T_IPC_DISPATCHERdispatcher
; T_IPC_SRVsrv
; T_IPC_MTmt
; 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
mt
the message type 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 TipcEventCreateMsgType fails, it returns FALSE
and sets the global SmartSockets error number to:
TipcEventCreateMsgType creates a message event of type T_IPC_EVENT_MSG_TYPE to be invoked when a message arrives on the srv
connection whose destination matches the mt
.
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, TipcEventCreateMsg
This example creates a message event triggered by a message’s type:
void T_ENTRY msgTypeFunc(T_IPC_EVENT event, T_IPC_EVENT_DATA data, T_PTR arg) { TipcMsgPrint(data->msg, TutOut); }/* =========================================================== */
/*...code from main program is below */
msg_event = TipcEventCreateMsgType(dispatcher, srv, mt, msgTypeFunc, 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 |