![]() |
libgpac
Documentation of the core library of GPAC
|
Data Structures | |
| struct | RMT_Settings |
| Struture to fill in to modify default settings. More... | |
Typedefs | |
| typedef void(* | rmt_on_new_client_cbk) (void *task, void *new_client) |
| typedef void(* | rmt_client_on_data_cbk) (void *task, const u8 *payload, u64 size, Bool is_binary) |
| typedef void(* | rmt_client_on_del_cbk) (void *task) |
Enumerations | |
| enum | RMT_Callback_type { RMT_CALLBACK_NONE =0x12 , RMT_CALLBACK_JS , RMT_CALLBACK_NODE } |
Functions | |
| RMT_WS * | rmt_ws_new () |
| creates the main instance | |
| void | rmt_ws_del (RMT_WS *rmt_ws) |
| deletes the main instance | |
| RMT_Settings * | gf_rmt_get_settings () |
| gets the current rmtws settings (creates the structure if necessary) | |
| void | gf_rmt_set_on_new_client_cbk (void *task, rmt_on_new_client_cbk cbk) |
| void * | gf_rmt_get_on_new_client_task () |
| gets the userdata associated with the new client callback if defined | |
| const char * | gf_rmt_get_peer_address (RMT_ClientCtx *client) |
| GF_Err | gf_rmt_client_send_to_ws (RMT_ClientCtx *client, const char *msg, u64 size, Bool is_binary) |
| void | gf_rmt_client_set_on_data_cbk (RMT_ClientCtx *client, void *task, rmt_client_on_data_cbk cbk) |
| void * | gf_rmt_client_get_on_data_task (RMT_ClientCtx *client) |
| gets the userdata associated with the client on data callback if defined | |
| void | gf_rmt_client_set_on_del_cbk (RMT_ClientCtx *client, void *task, rmt_client_on_del_cbk cbk) |
| void * | gf_rmt_client_get_on_del_task (RMT_ClientCtx *client) |
| gets the userdata associated with the client on deleted callback if defined | |
| struct RMT_Settings |
Struture to fill in to modify default settings.
| Data Fields | ||
|---|---|---|
| u16 | port | Which port to listen for incoming connections on. |
| u32 | timeout_secs | inactivity timeout before closing connections |
| u32 | ping_secs | time between websocket ping requests (0 to disable) |
| Bool | limit_connections_to_localhost | Only allow connections on localhost? |
| u32 | msSleepBetweenServerUpdates | How long to sleep between server updates. |
| rmt_on_new_client_cbk | on_new_client_cbk | function to call when a new websocket connection is accepted |
| void * | on_new_client_cbk_task | context for on_new_client_cbk |
| const char * | cert | server certificate and private key to use for ssl websocket (null to disable wss) |
| const char * | pkey | |
| typedef void(* rmt_on_new_client_cbk) (void *task, void *new_client) |
type for callbacks called when a new client connects
| task | user data sent back to the callback |
| new_client | a structure representing the client (of type RMT_ClientCtx) |
type for callbacks called when a client receives data on the websocket
| task | user data passed back to the callback |
| payload | a buffer containing the data received |
| size | the size of the data received |
| is_binary | false the data is a utf8 string, true otherwise |
| typedef void(* rmt_client_on_del_cbk) (void *task) |
type for callbacks called when a client is deleted (e.g. on disconnects)
| task | user data passed back to the callback |
| enum RMT_Callback_type |
| RMT_WS * rmt_ws_new | ( | ) |
creates the main instance
Here is the call graph for this function:
Here is the caller graph for this function:| void rmt_ws_del | ( | RMT_WS * | rmt_ws | ) |
deletes the main instance
Here is the call graph for this function:
Here is the caller graph for this function:| RMT_Settings * gf_rmt_get_settings | ( | ) |
gets the current rmtws settings (creates the structure if necessary)
Here is the caller graph for this function:| void gf_rmt_set_on_new_client_cbk | ( | void * | task, |
| rmt_on_new_client_cbk | cbk | ||
| ) |
sets the callback called when new clients connect to the sever
| task | user data stored and passed back to the callback |
| cbk | the callback of type rmt_on_new_client_cbk |
Here is the call graph for this function:| void * gf_rmt_get_on_new_client_task | ( | ) |
gets the userdata associated with the new client callback if defined
| const char * gf_rmt_get_peer_address | ( | RMT_ClientCtx * | client | ) |
gets a string representing the client in the format ip:port
| client | the client object |
| GF_Err gf_rmt_client_send_to_ws | ( | RMT_ClientCtx * | client, |
| const char * | msg, | ||
| u64 | size, | ||
| Bool | is_binary | ||
| ) |
sends data to a client on the websocket
| client | the client object |
| msg | a buffer containing the data to send |
| size | the size of the data to send |
| is_binary | false if we're sending a utf8 string, true otherwise |
Here is the call graph for this function:| void gf_rmt_client_set_on_data_cbk | ( | RMT_ClientCtx * | client, |
| void * | task, | ||
| rmt_client_on_data_cbk | cbk | ||
| ) |
sets the callback called when a client receives data
| client | the client for which we are setting the callback |
| task | user data stored and passed back to the callback |
| cbk | the callback of type rmt_client_on_data_cbk |
| void * gf_rmt_client_get_on_data_task | ( | RMT_ClientCtx * | client | ) |
gets the userdata associated with the client on data callback if defined
| void gf_rmt_client_set_on_del_cbk | ( | RMT_ClientCtx * | client, |
| void * | task, | ||
| rmt_client_on_del_cbk | cbk | ||
| ) |
sets the callback called when a client is deleted
| client | the client for which we are setting the callback |
| task | user data stored and passed back to the callback |
| cbk | the callback of type rmt_client_on_del_cbk |
| void * gf_rmt_client_get_on_del_task | ( | RMT_ClientCtx * | client | ) |
gets the userdata associated with the client on deleted callback if defined