tec_get_event
The tec_get_event function allows an application to receive events. It receives events from the configured transport, on demand. The data returned can contain more than one event. Use the ed_scan_n utility to determine the number of events. The memory allocated for the event must be freed.
Synopsis
long tec_get_event (tec_handle_t th, unsigned char ** event_message);
Arguments
- th
- The event server handle returned from a call to a create_handle function.
- event_message
- Contains the event data of the message received from a transport.
Examples
#include "tec_eeif.h"
char *event;
long event_len;
int rc;
event=NULL;
event_len = tec_get_event(th, &event);
if (event && event_len)
{
n =ed_scan_n (event,event_len);
}
if (event)
free(event)
Return codes
Returns the length of the event message. Returns 0 (zero) when no events are available.