freddie v0.1.3 Freddie.Session

Freddie.Session is a single-ended endpoint that abstracts network connections with clients. You can perform Reliable, Unreliable communications based on TCP, RUDP protocol.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Incomming data handler

Returns the pid of the session process associated with the passed context.

Examples

case lookup_pid(context) do
  {:ok, pid} ->
    # do something

Sends packets to clients associated with passed context

Update the context bound to session. (This request is handled asynchronously through a cast call internally, so it is likely that other processes will temporarily refer to the previous context.)

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_info(msg, state)

Incomming data handler

Link to this function

lookup_pid(context)

Returns the pid of the session process associated with the passed context.

Examples

case lookup_pid(context) do
  {:ok, pid} ->
    # do something

  other ->
    {:error, other}
end
Link to this function

send(context, msg, opts \\ [])

Sends packets to clients associated with passed context.

Link to this function

update_context(new_context)

Update the context bound to session. (This request is handled asynchronously through a cast call internally, so it is likely that other processes will temporarily refer to the previous context.)