Fork me on GitHub
Functions
transport.c File Reference
#include "transport.h"
Include dependency graph for transport.c:

Functions

janus_transport_sessionjanus_transport_session_create (void *transport_p, void(*p_free)(void *))
 Helper to create a janus_transport_session instance. More...
 
void janus_transport_session_destroy (janus_transport_session *session)
 Helper to mark a janus_transport_session instance as destroyed. More...
 

Function Documentation

◆ janus_transport_session_create()

janus_transport_session* janus_transport_session_create ( void *  transport_p,
void(*)(void *)  p_free 
)

Helper to create a janus_transport_session instance.

Note
This helper automatically initializes the reference counter
Parameters
transport_pPointer to the transport-side session instance (won't be touched by the core)
p_freePointer to the transport-provided function, if needed, that will be used to free the opaque transport-side session instance (won't be touched by the core)
Returns
Pointer to a valid janus_transport_session, if successful, NULL otherwise

◆ janus_transport_session_destroy()

void janus_transport_session_destroy ( janus_transport_session session)

Helper to mark a janus_transport_session instance as destroyed.

Note
Only use this helper when that specific transport session must not be used by the core anymore: e.g., a WebSocket connection was closed, an HTTP connection associated with a pending request was lost, etc. Remember to decrease the counter in case you increased it in other methods (this method does this automatically as far as the create was concerned).
Parameters
sessionPointer to the janus_transport_session instance