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
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
handle_info(msg, state)
Incomming data handler
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
send(context, msg, opts \\ [])
Sends packets to clients associated with passed context.
start_link()
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.)