View Source esockd (esockd v5.9.3-rc.1)
Link to this section Summary
Functions
Allow access address
Create a Child spec for a TCP/SSL Listener. It is a convenient method for creating a Child spec to hang on another Application supervisor.
Close the listener
just close port, don't kill esockd supervisor process made connection close
Deny access address
Create a Child spec for a DTLS Listener.
Parse Address
Get acceptors number
Get access rules
Get current connections
Set max connection rate
Get max connections
Get options
Get shutdown count
Get stats
Get one listener.
Get listeners.
Merge two options
Open a TCP or SSL listener
Open a DTLS listener
Open a UDP listener
Parse option.
Reopen the listener
resume port when use close port
Set max connection rate
Set max connections
Start esockd application.
Create a Child spec for a UDP Listener.
System 'ulimit -n'
Link to this section Types
-type conn_limit() :: map() | {pos_integer(), pos_integer()}.
-type dtls_options() :: [{handshake_timeout, pos_integer()} | ssl:ssl_option()].
-type host() :: inet:ip_address() | string().
-type listen_on() :: inet:port_number() | {host(), inet:port_number()}.
-type mfargs() :: atom() | {atom(), atom()} | {module(), atom(), [term()]}.
-type option() :: {acceptors, pos_integer()} | {max_connections, pos_integer()} | {max_conn_rate, conn_limit()} | {access_rules, [esockd_access:rule()]} | {shutdown, brutal_kill | infinity | pos_integer()} | tune_buffer | {tune_buffer, boolean()} | proxy_protocol | {proxy_protocol, boolean()} | {proxy_protocol_timeout, timeout()} | {ssl_options, ssl_options()} | {tcp_options, [gen_tcp:listen_option()]} | {udp_options, [gen_udp:option()]} | {dtls_options, dtls_options()}.
-type options() :: [option()].
-type proto() :: atom().
-type sock_fun() :: {function(), list()}.
-type socket() :: esockd_transport:socket().
-type ssl_options() :: [{handshake_timeout, pos_integer()} | ssl:ssl_option()].
-type transport() :: module().
-type udp_transport() :: {udp | dtls, pid(), inet:socket()}.
Link to this section Functions
-spec allow({atom(), listen_on()}, all | esockd_cidr:cidr_string()) -> ok.
-spec child_spec(atom(), listen_on(), [option()], mfargs()) -> supervisor:child_spec().
-spec close({atom(), listen_on()}) -> ok | {error, term()}.
-spec close(atom(), listen_on()) -> ok | {error, term()}.
-spec close_port({atom(), listen_on()}) -> ok | {error, term()}.
-spec close_port(atom(), listen_on()) -> ok | {error, term()}.
-spec deny({atom(), listen_on()}, all | esockd_cidr:cidr_string()) -> ok.
-spec dtls_child_spec(atom(), listen_on(), options(), mfargs()) -> supervisor:child_spec().
-spec format({inet:ip_address(), inet:port_number()}) -> string().
-spec get_acceptors({atom(), listen_on()}) -> pos_integer().
-spec get_access_rules({atom(), listen_on()}) -> [esockd_access:rule()].
-spec get_current_connections({atom(), listen_on()}) -> non_neg_integer().
-spec get_max_conn_rate({atom(), listen_on()}) -> conn_limit().
-spec get_max_connections({atom(), listen_on()} | pid()) -> pos_integer().
-spec get_shutdown_count({atom(), listen_on()}) -> pos_integer().
-spec get_stats({atom(), listen_on()}) -> [{atom(), non_neg_integer()}].
-spec listener({atom(), listen_on()}) -> pid().
-spec listeners() -> [{{atom(), listen_on()}, pid()}].
-spec merge_opts(proplists:proplist(), proplists:proplist()) -> proplists:proplist().
-spec reopen({atom(), listen_on()}) -> {ok, pid()} | {error, term()}.
-spec reopen(atom(), listen_on()) -> {ok, pid()} | {error, term()}.
-spec resume_port({atom(), listen_on()}) -> ok | {error, term()}.
-spec resume_port(atom(), listen_on()) -> ok | {error, term()}.
-spec set_max_conn_rate({atom(), listen_on()}, conn_limit()) -> ok.
-spec set_max_connections({atom(), listen_on()}, pos_integer()) -> ok.
-spec start() -> ok.
-spec to_string(listen_on()) -> string().
-spec udp_child_spec(atom(), listen_on(), options(), mfargs()) -> supervisor:child_spec().
-spec ulimit() -> pos_integer().