The transport plugin session and callbacks interface.
More...
#include <transport.h>
|
int(*const | init )(janus_transport_callbacks *callback, const char *config_path) |
| Transport plugin initialization/constructor. More...
|
|
void(*const | destroy )(void) |
| Transport plugin deinitialization/destructor. More...
|
|
int(*const | get_api_compatibility )(void) |
| Informative method to request the API version this transport plugin was compiled against. More...
|
|
int(*const | get_version )(void) |
| Informative method to request the numeric version of the transport plugin. More...
|
|
const char *(*const | get_version_string )(void) |
| Informative method to request the string version of the transport plugin. More...
|
|
const char *(*const | get_description )(void) |
| Informative method to request a description of the transport plugin. More...
|
|
const char *(*const | get_name )(void) |
| Informative method to request the name of the transport plugin. More...
|
|
const char *(*const | get_author )(void) |
| Informative method to request the author of the transport plugin. More...
|
|
const char *(*const | get_package )(void) |
| Informative method to request the package name of the transport plugin (what will be used in web applications to refer to it) More...
|
|
gboolean(*const | is_janus_api_enabled )(void) |
| Informative method to check whether any Janus API support is currently enabled in this transport. More...
|
|
gboolean(*const | is_admin_api_enabled )(void) |
| Informative method to check whether any Admin API support is currently enabled in this transport. More...
|
|
int(*const | send_message )(janus_transport_session *transport, void *request_id, gboolean admin, json_t *message) |
| Method to send a message to a client over a transport session. More...
|
|
void(*const | session_created )(janus_transport_session *transport, guint64 session_id) |
| Method to notify the transport plugin that a new session has been created from this transport. More...
|
|
void(*const | session_over )(janus_transport_session *transport, guint64 session_id, gboolean timeout, gboolean claimed) |
| Method to notify the transport plugin that a session it originated timed out. More...
|
|
void(*const | session_claimed )(janus_transport_session *transport, guint64 session_id) |
| Method to notify the transport plugin that a session it owned was claimed by another transport. More...
|
|
The transport plugin session and callbacks interface.
void(* const janus_transport::destroy) (void) |
Transport plugin deinitialization/destructor.
int(* const janus_transport::get_api_compatibility) (void) |
Informative method to request the API version this transport plugin was compiled against.
- Note
- All transport plugins MUST implement this method and return JANUS_TRANSPORT_API_VERSION to make this work, or they will be rejected by the core.
const char*(* const janus_transport::get_author) (void) |
Informative method to request the author of the transport plugin.
const char*(* const janus_transport::get_description) (void) |
Informative method to request a description of the transport plugin.
const char*(* const janus_transport::get_name) (void) |
Informative method to request the name of the transport plugin.
const char*(* const janus_transport::get_package) (void) |
Informative method to request the package name of the transport plugin (what will be used in web applications to refer to it)
int(* const janus_transport::get_version) (void) |
Informative method to request the numeric version of the transport plugin.
const char*(* const janus_transport::get_version_string) (void) |
Informative method to request the string version of the transport plugin.
Transport plugin initialization/constructor.
- Parameters
-
[in] | callback | The callback instance the transport plugin can use to contact the Janus core |
[in] | config_path | Path of the folder where the configuration for this transport plugin can be found |
- Returns
- 0 in case of success, a negative integer in case of error
gboolean(* const janus_transport::is_admin_api_enabled) (void) |
Informative method to check whether any Admin API support is currently enabled in this transport.
gboolean(* const janus_transport::is_janus_api_enabled) (void) |
Informative method to check whether any Janus API support is currently enabled in this transport.
Method to send a message to a client over a transport session.
- Note
- It's the transport plugin's responsibility to free the message. Besides, a successful return does not necessarily mean the message has been actually sent, but only that it has been accepted by the transport plugim
- Parameters
-
[in] | transport | Pointer to the transport session instance |
[in] | request_id | Will be not-NULL in case this is a response to a previous request |
[in] | admin | Whether this is an admin API or a Janus API message |
[in] | message | The message data as a Jansson json_t object |
- Returns
- 0 on success, a negative integer otherwise
Method to notify the transport plugin that a session it owned was claimed by another transport.
- Note
- A transport plugin should close the connection as a result of such an event
- Parameters
-
[in] | transport | Pointer to the new transport session instance that has claimed the session |
[in] | session_id | The session ID that was claimed (if the transport cares) |
Method to notify the transport plugin that a new session has been created from this transport.
- Note
- A transport plugin may decide to close the connection as a result of such an event
- Parameters
-
[in] | transport | Pointer to the transport session instance |
[in] | session_id | The session ID that was created (if the transport cares) |
void(* const janus_transport::session_over) (janus_transport_session *transport, guint64 session_id, gboolean timeout, gboolean claimed) |
Method to notify the transport plugin that a session it originated timed out.
- Note
- A transport plugin may decide to close the connection as a result of such an event
- Parameters
-
[in] | transport | Pointer to the transport session instance |
[in] | session_id | The session ID that was closed (if the transport cares) |
[in] | timeout | Whether the cause for the session closure is a timeout (this may interest transport plugins more) |
[in] | claimed | Whether the cause for the session closure is due to someone claiming the session |
The documentation for this struct was generated from the following file: