quicer_listener (quicer v0.4.3)

View Source

Summary

Functions

count accepted but not yet closed connections

get the listener configuration

Reload the listener with new *listener* opts.

Reload the listener with new *listener* opts and new listen_on.

Types

active_n/0

-type active_n() :: boolean() | once | integer().

alpn/0

-type alpn() :: string().

conf_handle/0

-type conf_handle() :: reference().

conn_opts/0

-type conn_opts() ::
          #{alpn := [string()],
            conn_callback => module(),
            custom_verify => boolean(),
            handle => connection_handle(),
            nst => binary(),
            handshake_idle_timeout_ms => non_neg_integer(),
            quic_event_mask => uint32(),
            disable_1rtt_encryption => boolean(),
            local_address => string(),
            local_bidi_stream_count => uint16(),
            local_peer_unidi_stream_count => uint16(),
            cert => file:filename(),
            certfile => file:filename(),
            key => file:filename(),
            keyfile => file:filename(),
            password => string(),
            verify => none | peer | verify_peer | verify_none,
            cacertfile => file:filename(),
            sslkeylogfile => file:filename(),
            max_bytes_per_key => uint64(),
            handshake_idle_timeout_ms => uint64(),
            idle_timeout_ms => uint64(),
            tls_client_max_send_buffer => uint32(),
            tls_server_max_send_buffer => uint32(),
            stream_recv_window_default => uint32(),
            stream_recv_buffer_default => uint32(),
            conn_flow_control_window => uint32(),
            max_stateless_operations => uint32(),
            initial_window_packets => uint32(),
            send_idle_timeout_ms => uint32(),
            initial_rtt_ms => uint32(),
            max_ack_delay_ms => uint32(),
            disconnect_timeout_ms => uint32(),
            keep_alive_interval_ms => uint32(),
            congestion_control_algorithm => uint16(),
            peer_bidi_stream_count => uint16(),
            peer_unidi_stream_count => uint16(),
            retry_memory_limit => uint16(),
            load_balancing_mode => uint16(),
            max_operations_per_drain => uint8(),
            send_buffering_enabled => uint8(),
            pacing_enabled => uint8(),
            migration_enabled => uint8(),
            datagram_receive_enabled => uint8(),
            server_resumption_level => uint8(),
            minimum_mtu => uint16(),
            maximum_mtu => uint16(),
            mtu_discovery_search_complete_timeout_us => uint64(),
            mtu_discovery_missing_probe_count => uint8(),
            max_binding_stateless_operations => uint16(),
            stateless_operation_expiration_ms => uint16(),
            dynamic() => dynamic()}.

connection_handle/0

-type connection_handle() :: reference().

global_handle/0

-type global_handle() :: quic_global.

handle/0

listen_opts/0

-type listen_opts() ::
          #{alpn := [alpn()],
            allow_insecure => boolean(),
            quic_registration => reg_handle(),
            conn_acceptors => non_neg_integer(),
            cert => file:filename(),
            certfile => file:filename(),
            key => file:filename(),
            keyfile => file:filename(),
            password => string(),
            verify => none | peer | verify_peer | verify_none,
            cacertfile => file:filename(),
            sslkeylogfile => file:filename(),
            max_bytes_per_key => uint64(),
            handshake_idle_timeout_ms => uint64(),
            idle_timeout_ms => uint64(),
            tls_client_max_send_buffer => uint32(),
            tls_server_max_send_buffer => uint32(),
            stream_recv_window_default => uint32(),
            stream_recv_buffer_default => uint32(),
            conn_flow_control_window => uint32(),
            max_stateless_operations => uint32(),
            initial_window_packets => uint32(),
            send_idle_timeout_ms => uint32(),
            initial_rtt_ms => uint32(),
            max_ack_delay_ms => uint32(),
            disconnect_timeout_ms => uint32(),
            keep_alive_interval_ms => uint32(),
            congestion_control_algorithm => uint16(),
            peer_bidi_stream_count => uint16(),
            peer_unidi_stream_count => uint16(),
            retry_memory_limit => uint16(),
            load_balancing_mode => uint16(),
            max_operations_per_drain => uint8(),
            send_buffering_enabled => uint8(),
            pacing_enabled => uint8(),
            migration_enabled => uint8(),
            datagram_receive_enabled => uint8(),
            server_resumption_level => uint8(),
            minimum_mtu => uint16(),
            maximum_mtu => uint16(),
            mtu_discovery_search_complete_timeout_us => uint64(),
            mtu_discovery_missing_probe_count => uint8(),
            max_binding_stateless_operations => uint16(),
            stateless_operation_expiration_ms => uint16()}.

listener_handle/0

-type listener_handle() :: reference().

listener_name/0

-type listener_name() :: atom().

listener_opts/0

reg_handle/0

-type reg_handle() :: reference().

stream_handle/0

-type stream_handle() :: reference().

stream_open_flags/0

-type stream_open_flags() :: 0 | 1 | 2.

stream_opts/0

-type stream_opts() ::
          #{active := active_n(),
            open_flag => stream_open_flags(),
            start_flag => stream_start_flags(),
            event_mask => uint32(),
            disable_fpbuffer => boolean(),
            stream_id => uint62(),
            priority => uint16(),
            ideal_send_buffer_size => uint64(),
            '0rtt_length' => uint64(),
            dynamic() => dynamic()}.

stream_start_flags/0

-type stream_start_flags() :: 0 | 1 | 2 | 4 | 8.

uint8/0

-type uint8() :: 0..1 bsl 8 - 1.

uint16/0

-type uint16() :: 0..1 bsl 16 - 1.

uint32/0

-type uint32() :: 0..1 bsl 32 - 1.

uint62/0

-type uint62() :: 0..1 bsl 62 - 1.

uint64/0

-type uint64() :: 0..1 bsl 64 - 1.

Functions

count_conns(Pid)

-spec count_conns(pid()) -> non_neg_integer().

count accepted but not yet closed connections

get_conf(Pid, Timeout)

-spec get_conf(pid(), timeout()) -> listener_opts().

get the listener configuration

get_handle(Pid, Timeout)

-spec get_handle(pid(), timeout()) -> quicer:listener_handle().

lock(Pid, Timeout)

-spec lock(pid(), timeout()) -> ok | {error, _}.

reload(Pid, NewConf)

-spec reload(pid(), NewConf :: map()) -> ok | {error, _}.

Reload the listener with new *listener* opts.

reload(Pid, ListenOn, NewConf)

-spec reload(pid(), quicer:listen_on(), NewConf :: listener_opts()) -> ok | {error, _}.

Reload the listener with new *listener* opts and new listen_on.

start_link(Name, ListenOn, Options)

-spec start_link(Name :: listener_name(),
                 ListenOn :: quicer:listen_on(),
                 Options :: quicer:listener_opts()) ->
                    {ok, Pid :: pid()} |
                    {error, Error :: {already_started, pid()}} |
                    {error, Error :: term()} |
                    ignore.

Starts the server

start_listener(Name, ListenOn, Options)

stop_listener(Name)

unlock(Pid, Timeout)

-spec unlock(pid(), timeout()) -> ok | {error, _}.