Xirsys.Sockets.Conn (xturn_sockets v1.2.0)

View Source

Socket connection object for TURN

Summary

Functions

Flags a connection object as halted, so it shouldn't be processed any further

If a response message has been set, then we must notify the client accordingly

Types

t()

@type t() ::
  {listener :: :gen_tcp.socket() | :gen_udp.socket() | :ssl.sslsocket(),
   message :: binary(), decoded_message :: any(),
   client_socket :: :gen_tcp.socket() | :gen_udp.socket() | :ssl.sslsocket(),
   client_ip :: tuple(), client_port :: integer(), server_ip :: tuple(),
   server_port :: integer(), is_control :: boolean(), force_auth :: boolean(),
   response :: Xirsys.Sockets.Response.t(), halt :: boolean(), cache :: map()}

Functions

halt(conn)

@spec halt(t()) :: t()

Flags a connection object as halted, so it shouldn't be processed any further

response(conn, class, attrs \\ nil)

@spec response(
  %Xirsys.Sockets.Conn{
    cache: term(),
    client_ip: term(),
    client_port: term(),
    client_socket: term(),
    decoded_message: term(),
    force_auth: term(),
    halt: term(),
    is_control: term(),
    listener: term(),
    message: term(),
    response: term(),
    server_ip: term(),
    server_port: term()
  },
  atom() | integer(),
  binary() | any()
) :: %Xirsys.Sockets.Conn{
  cache: term(),
  client_ip: term(),
  client_port: term(),
  client_socket: term(),
  decoded_message: term(),
  force_auth: term(),
  halt: term(),
  is_control: term(),
  listener: term(),
  message: term(),
  response: term(),
  server_ip: term(),
  server_port: term()
}

send(conn)

@spec send(%Xirsys.Sockets.Conn{
  cache: term(),
  client_ip: term(),
  client_port: term(),
  client_socket: term(),
  decoded_message: term(),
  force_auth: term(),
  halt: term(),
  is_control: term(),
  listener: term(),
  message: term(),
  response: term(),
  server_ip: term(),
  server_port: term()
}) :: %Xirsys.Sockets.Conn{
  cache: term(),
  client_ip: term(),
  client_port: term(),
  client_socket: term(),
  decoded_message: term(),
  force_auth: term(),
  halt: term(),
  is_control: term(),
  listener: term(),
  message: term(),
  response: term(),
  server_ip: term(),
  server_port: term()
}

If a response message has been set, then we must notify the client accordingly