glisten/socket/options

Types

Mapping to the {active, _} option

pub type ActiveState {
  Once
  Passive
  Count(Int)
  Active
}

Constructors

  • Once
  • Passive
  • Count(Int)
  • Active
pub type Interface {
  Address(IpAddress)
  Any
  Loopback
}

Constructors

  • Address(IpAddress)
  • Any
  • Loopback
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)
  Certfile(String)
  Keyfile(String)
  AlpnPreferredProtocols(List(String))
  Ipv6
  Buffer(Int)
  Ip(Interface)
}

Constructors

  • Backlog(Int)
  • Nodelay(Bool)
  • Linger(#(Bool, Int))
  • SendTimeout(Int)
  • SendTimeoutClose(Bool)
  • Reuseaddr(Bool)
  • ActiveMode(ActiveState)
  • Mode(SocketMode)
  • Certfile(String)
  • Keyfile(String)
  • AlpnPreferredProtocols(List(String))
  • Ipv6
  • Buffer(Int)
  • Ip(Interface)

Constants

pub const default_options: List(TcpOption)

Functions

pub fn merge_with_defaults(
  options: List(TcpOption),
) -> List(TcpOption)
pub fn to_dict(
  options: List(TcpOption),
) -> Dict(Dynamic, Dynamic)
Search Document