• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

config/H26-Jul-2016-21

examples/tcp_connection/H26-Jul-2016-158132

lib/H26-Jul-2016-830721

test/H26-Jul-2016-1,1131,006

.gitignoreH A D26-Jul-201634 54

.travis.ymlH A D26-Jul-2016243 1615

LICENSEH A D26-Jul-201611.1 KiB203169

README.mdH A D26-Jul-20161.6 KiB4838

mix.exsH A D26-Jul-2016818 4335

mix.lockH A D26-Jul-2016293 32

README.md

1Connection
2==========
3
4`Connection` behaviour for connection processes. The API is superset of the
5GenServer API. There are 2 additional callbacks `connect/2` and `disconnect/2`:
6
7```elixir
8  @callback init(any) ::
9    {:ok, any} | {:ok, any, timeout | :hibernate} |
10    {:connect, any, any} |
11    {:backoff, timeout, any} | {:backoff, timeout, any, timeout | :hibernate} |
12    :ignore | {:stop, any}
13
14  @callback connect(any, any) ::
15    {:ok, any} | {:ok, any, timeout | :hibernate} |
16    {:backoff, timeout, any} | {:backoff, timeout, any, timeout | :hibernate} |
17    {:stop, any, any}
18
19  @callback disconnect(any, any) ::
20    {:connect, any, any} |
21    {:backoff, timeout, any} | {:backoff, timeout, any, timeout | :hibernate} |
22    {:noconnect, any} | {:noconnect, any, timeout | :hibernate}
23    {:stop, any, any}
24
25  @callback handle_call(any, {pid, any}, any) ::
26    {:reply, any, any} | {:reply, any, any, timeout | :hibernate} |
27    {:noreply, any} | {:noreply, any, timeout | :hibernate} |
28    {:disconnect | :connect, any, any} |
29    {:disconnect | :connect, any, any, any} |
30    {:stop, any, any} | {:stop, any, any, any}
31
32  @callback handle_cast(any, any) ::
33    {:noreply, any} | {:noreply, any, timeout | :hibernate} |
34    {:disconnect | :connect, any, any} |
35    {:stop, any, any}
36
37  @callback handle_info(any, any) ::
38    {:noreply, any} | {:noreply, any, timeout | :hibernate} |
39    {:disconnect | :connect, any, any} |
40    {:stop, any, any}
41
42  @callback code_change(any, any, any) :: {:ok, any}
43
44  @callback terminate(any, any) :: any
45```
46There is an example of a simple TCP connection process in
47`examples/tcp_connection/`.
48