Caracola.Transport.Handler behaviour (Caracola v0.1.0-rc.1)

Copy Markdown View Source

Receives the SIP messages arriving at a listener or connection.

Handlers are given as {module, arg} and called in the process owning the socket, so they should hand the message over to another process quickly. The Caracola.Transport.Port identifies where the message came from, and can be used to reply with Caracola.Transport.send/2.

Summary

Types

t()

A handler: a module implementing this behaviour and the argument given to its callback.

Callbacks

Called for each message received, in the process owning the socket. The return value is ignored.

Types

t()

@type t() :: {module(), term()}

A handler: a module implementing this behaviour and the argument given to its callback.

Callbacks

handle_message(t, t, arg)

@callback handle_message(Caracola.Transport.Port.t(), Caracola.Message.t(), arg :: term()) ::
  any()

Called for each message received, in the process owning the socket. The return value is ignored.