rt_set_callback
Description
The rt_set_callback function is used to set the callback functions for the RTTP engine.
Syntax:
void rt_set_callback(RTEngine engine, socket_event_callback *event_callback, send_data_callback *sendproc);
Parameters:
engine:
The pointer to the RTTP engine instance returned by rt_init().
event_callback: A function pointer used to notify the RTTP socket of events.
typedef void socket_event_callback(RTEngine engine, RTSOCKET socket, int event);
| Event Type | Type | Meaning |
|---|---|---|
RTTP_EVENT_CONNECT | int32 | RTTP socket connected |
RTTP_EVENT_READ | int32 | RTTP socket is readable |
RTTP_EVENT_WRITE | int32 | RTTP socket is writable |
RTTP_EVENT_ERROR | int32 | Error occurred on RTTP socket |
sendproc: A function pointer used to send data packets generated by the RTTP engine.
typedef void send_data_callback(RTEngine engine, RTSOCKET socket, const char * buffer, int len, const struct sockaddr* addr, int addr_len);
Return Value:
This function does not return a value.