View Source quicer_listener (quicer v0.2.12)

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

-type active_n() :: boolean() | once | integer().
-type alpn() :: string().
-type conf_handle() :: reference().
-type conn_opts() ::
    quic_settings() |
    #{alpn := [string()],
      conn_callback => module(),
      cert => file:filename(),
      certfile => file:filename(),
      key => file:filename(),
      keyfile => file:filename(),
      password => string(),
      verify => none | peer,
      custom_verify => boolean(),
      handle => connection_handle(),
      nst => binary(),
      cacertfile => file:filename(),
      sslkeylogfile => file:filename(),
      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(),
      _ => _}.
-type connection_handle() :: reference().
-type global_handle() :: quic_global.
-type listen_opts() :: listen_security_opts() | quic_settings().
Link to this type

listen_security_opts/0

View Source
-type listen_security_opts() ::
    #{alpn := [alpn()],
      cert := file:filename(),
      certfile := file:filename(),
      key := file:filename(),
      keyfile := file:filename(),
      verify => none | peer | verify_peer | verify_none,
      cacertfile => file:filename(),
      password => string(),
      sslkeylogfile => file:filename(),
      allow_insecure => boolean(),
      quic_registration => reg_handle(),
      conn_acceptors => non_neg_integer()}.
-type listener_handle() :: reference().
-type listener_name() :: atom().
-type quic_settings() ::
    #{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()}.
-type reg_handle() :: reference().
-type stream_handle() :: reference().
-type stream_open_flags() :: 0 | 1 | 2.
-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(),
      _ => _}.
-type stream_start_flags() :: 0 | 1 | 2 | 4 | 8.
-type uint8() :: 0..1 bsl 8 - 1.
-type uint16() :: 0..1 bsl 16 - 1.
-type uint32() :: 0..1 bsl 32 - 1.
-type uint62() :: 0..1 bsl 62 - 1.
-type uint64() :: 0..1 bsl 64 - 1.

Functions

-spec count_conns(pid()) -> non_neg_integer().
count accepted but not yet closed connections
-spec get_conf(pid(), timeout()) -> listener_opts().
get the listener configuration
Link to this function

get_handle(Pid, Timeout)

View Source
-spec get_handle(pid(), timeout()) -> quicer:listener_handle().
-spec lock(pid(), timeout()) -> ok | {error, _}.
-spec reload(pid(), NewConf :: map()) -> ok | {error, _}.
Reload the listener with new *listener* opts.
Link to this function

reload(Pid, ListenOn, NewConf)

View Source
-spec reload(pid(), quicer:listen_on(), NewConf :: listener_opts()) -> ok | {error, _}.
Reload the listener with new *listener* opts and new listen_on.
Link to this function

start_link(Name, ListenOn, Options)

View Source
-spec start_link(Name :: listener_name(),
           ListenOn :: quicer:listen_on(),
           Options :: {quicer:listener_opts(), quicer:conn_opts(), quicer:stream_opts()}) ->
              {ok, Pid :: pid()} |
              {error, Error :: {already_started, pid()}} |
              {error, Error :: term()} |
              ignore.
Starts the server
Link to this function

start_listener(Name, ListenOn, Options)

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