NosProtocol v1.0.0 NosProtocol.Conn View Source

This module provides a data structure that represents an NosTale socket connection to a given server. The connection is represented as an opaque struct %NosProtocol.Conn{}. The connection is a data structure and is not backed by a process, and all the connection handling happens in the process that creates the struct.

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %NosProtocol.Conn{
  assigns: map(),
  encoder: module(),
  private: map(),
  socket: :inet.socket(),
  state: atom(),
  transport: module()
}

Link to this section Functions

Link to this function

assign(conn, key, value)

View Source
assign(t(), any(), any()) :: t()
Link to this function

merge_assigns(conn, keyword)

View Source
merge_assigns(t(), keyword()) :: t()
Link to this function

merge_private(conn, keyword)

View Source
merge_private(t(), keyword()) :: t()
Link to this function

put_private(conn, key, value)

View Source
put_private(t(), any(), any()) :: t()
Link to this function

put_state(conn, state)

View Source
put_state(t(), atom()) :: t()
Link to this function

render(conn, encoder, template, param)

View Source
render(t(), module(), any(), keyword()) :: t()
Link to this function

send_packet(conn, data)

View Source
send_packet(t(), keyword()) :: t()