View Source Membrane.RTSP.Transport behaviour (Membrane RTSP v0.6.2)
Behaviour describing Transport Layer for Real Time Streaming Protocol
Summary
Callbacks
Callback used for cleaning up the transport layer when the session is closed.
Callback for executing requests with a given transport layer.
Callback for handling any transport-layer specific messages. Session will redirect any unknown messages to this callback.
Callback for initialization of transport layer implementation.
Functions
Callbacks
@callback close(state :: any()) :: :ok
Callback used for cleaning up the transport layer when the session is closed.
@callback execute(request :: any(), state :: any(), options :: Keyword.t()) :: :ok | {:ok, reply :: any()} | {:error, reason :: any()}
Callback for executing requests with a given transport layer.
@callback handle_info(msg :: any(), state :: any()) :: {action :: term(), state :: any()} | {action :: term(), reply :: any(), state :: any()}
Callback for handling any transport-layer specific messages. Session will redirect any unknown messages to this callback.
It is useful for eg. correctly handling :tcp_close message and similar.
Callback for initialization of transport layer implementation.
Upon successful initialization, the callback should return {:ok, state}. Value of state can be anything, but it is recommended that it contains some information that identifies a transport layer instance.