View Source Membrane.RTMP.Source.SslServer (Membrane RTMP plugin v0.23.2)

A simple ssl server, which handles each new incoming connection.

The socket_handler function passed inside the options should take the socket returned by :ssl.handshake/1 and return {:ok, pid}, where the pid describes a process, which will be interacting with the socket. The process will be temporarily linked with a Membrane.RTMP.Source.SslServer worker process until it successfully grants it the control over the socket using :ssl.controlling_process/2.

Summary

Types

t()

Defines options for the SSL server. The listen_options are passed to the :ssl.listen/2 function. The socket_handler is a function that takes socket returned by :gen_tcp.accept/1 and returns the pid of a process, which will be interacting with the socket. SslServer will grant that process control over the socket via :ssl.controlling_process/2.

Functions

Returns a specification to start this module under a supervisor.

Types

@type t() :: %Membrane.RTMP.Source.SslServer{
  listen_options: [:inet.inet_backend() | :ssl.tls_server_option()],
  parent: pid(),
  port: :inet.port_number(),
  socket_handler: (:ssl.sslsocket() -> {:ok, pid()} | {:error, reason :: any()})
}

Defines options for the SSL server. The listen_options are passed to the :ssl.listen/2 function. The socket_handler is a function that takes socket returned by :gen_tcp.accept/1 and returns the pid of a process, which will be interacting with the socket. SslServer will grant that process control over the socket via :ssl.controlling_process/2.

Functions

Returns a specification to start this module under a supervisor.

arg is passed as the argument to Task.start_link/1 in the :start field of the spec.

For more information, see the Supervisor module, the Supervisor.child_spec/2 function and the Supervisor.child_spec/0 type.

@spec run(t()) :: no_return()
@spec start_link(t()) :: {:ok, pid()}