glisten/socket/options
Types
Mapping to the {active, _} option
pub type ActiveState {
Once
Passive
Count(Int)
Active
}
Constructors
-
OnceThe server acknowledges every package.
-
PassiveNot used by server - for use with low level
tcp.receive. -
Count(Int)The server will receive
npackages before activating again. -
ActiveConnection is always active, no flow control.
pub type ErlangTcpOption
pub type IpAddress {
IpV4(Int, Int, Int, Int)
IpV6(Int, Int, Int, Int, Int, Int, Int, Int)
}
Constructors
-
IpV4(Int, Int, Int, Int) -
IpV6(Int, Int, Int, Int, Int, Int, Int, Int)
Mode for the socket. Currently list is not supported
pub type SocketMode {
Binary
}
Constructors
-
Binary
Options for the TCP socket
pub type TcpOption {
Backlog(Int)
Nodelay(Bool)
Linger(#(Bool, Int))
SendTimeout(Int)
SendTimeoutClose(Bool)
Reuseaddr(Bool)
ActiveMode(ActiveState)
Mode(SocketMode)
CertKeyConfig(TlsCerts)
AlpnPreferredProtocols(List(String))
Ipv6
Buffer(Int)
Ip(Interface)
}
Constructors
-
Backlog(Int)Default 1024
-
Nodelay(Bool)Default True
-
Linger(#(Bool, Int)) -
SendTimeout(Int)Default 30_000
-
SendTimeoutClose(Bool)Default True
-
Reuseaddr(Bool)Default True
-
ActiveMode(ActiveState)Default Passive for low level and Once for server.
-
Mode(SocketMode)Default Binary
-
CertKeyConfig(TlsCerts) -
AlpnPreferredProtocols(List(String)) -
Ipv6 -
Buffer(Int) -
Ip(Interface)
Values
pub const default_options: List(TcpOption)
pub fn merge_type_list(
original: List(a),
override: List(a),
) -> List(a)
pub fn to_erl_options(
options: List(TcpOption),
) -> List(ErlangTcpOption)