glisten/ssl

Values

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

Start listening over TLS on a port with the given options

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

Update the optons for a socket (mutates the socket)

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