View Source ExLibSRT.Client (ExLibSRT v0.2.0)
Implementation of the SRT client.
API
The client API consinsts of the following functions:
start/3- starts a client connection to the serverstart/4- starts a client connection to the server with password authenticationstart_link/3- starts a client connection to the server and links to current processstart_link/4- starts a client connection to the server with password authentication and links to current processstart_link/5- starts a client connection to the server with password authentication, sets SRT latency and links to current processstop/1- stops the client connectionsend_data/2- sends a packet through the client connection
Password Authentication
When connecting to a server that requires password authentication:
- Password must be between 10 and 79 characters long (SRT specification requirement: https://github.com/Haivision/srt/blob/master/docs/API/API-socket-options.md#srto_passphrase)
- Empty string means no password authentication (default behavior)
- Password must match the server's password
A process starting the client will also receive the following notifications:
Summary
Functions
Returns a specification to start this module under a supervisor.
Reads socket statistics.
Sends data through the client connection.
Starts a new SRT connection to the target address and port outside the supervision tree.
Starts a new SRT connection to the target address and port and links to the current process.
Stops the active client connection.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec read_socket_stats(t()) :: {:ok, ExLibSRT.SocketStats.t()} | {:error, reason :: String.t()}
Reads socket statistics.
Sends data through the client connection.
@spec start( address :: String.t(), port :: non_neg_integer(), stream_id :: String.t(), password :: String.t() ) :: {:ok, t()} | {:error, reason :: String.t(), error_code :: integer()}
Starts a new SRT connection to the target address and port outside the supervision tree.
Password Authentication
If a password is provided, it must be between 10 and 79 characters long according to SRT specification. An empty string means no password authentication will be used.
start_link(address, port, stream_id, password \\ "", latency_ms \\ -1)
View Source@spec start_link( address :: String.t(), port :: non_neg_integer(), stream_id :: String.t(), password :: String.t(), latency_ms :: integer() ) :: {:ok, t()} | {:error, reason :: String.t(), error_code :: integer()}
Starts a new SRT connection to the target address and port and links to the current process.
Password Authentication
If a password is provided, it must be between 10 and 79 characters long according to SRT specification. An empty string means no password authentication will be used.
@spec stop(t()) :: :ok
Stops the active client connection.