glisten/ssl

Functions

pub fn accept(
  socket: ListenSocket,
) -> Result(Socket, SocketReason)
pub fn accept_timeout(
  socket: ListenSocket,
  timeout: Int,
) -> Result(Socket, SocketReason)
pub fn close(socket: Socket) -> Result(Nil, SocketReason)
pub fn controlling_process(
  socket: Socket,
  pid: Pid,
) -> Result(Nil, Atom)
pub fn do_shutdown(
  socket: Socket,
  write: Atom,
) -> Result(Nil, SocketReason)
pub fn get_socket_opts(
  socket: Socket,
  opts: List(Atom),
) -> Result(List(#(Atom, Dynamic)), Nil)
pub fn handshake(socket: Socket) -> Result(Socket, Nil)
pub fn listen(
  port: Int,
  options: List(TcpOption),
) -> Result(ListenSocket, SocketReason)

Start listening over SSL on a port with the given options

pub fn negotiated_protocol(
  socket: Socket,
) -> Result(String, String)
pub fn peername(socket: Socket) -> Result(#(Dynamic, Int), Nil)
pub fn receive(
  socket: Socket,
  length: Int,
) -> Result(BitArray, SocketReason)
pub fn receive_timeout(
  socket: Socket,
  length: Int,
  timeout: Int,
) -> Result(BitArray, SocketReason)
pub fn send(
  socket: Socket,
  packet: BytesBuilder,
) -> Result(Nil, SocketReason)
pub fn set_opts(
  socket: Socket,
  opts: List(TcpOption),
) -> Result(Nil, Nil)

Update the optons for a socket (mutates the socket)

pub fn shutdown(socket: Socket) -> Result(Nil, SocketReason)
pub fn sockname(
  socket: ListenSocket,
) -> Result(#(Dynamic, Int), SocketReason)
pub fn start() -> Result(Nil, Dynamic)
Search Document