diff options
author | Loïc Hoguin <[email protected]> | 2013-12-07 14:08:25 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-12-07 14:08:25 +0100 |
commit | 0770e2893f88cd50020a621e4d3b813ff8e6c58f (patch) | |
tree | db8086ef3b68ea205f69b7582334e579ff2dd907 /examples/tcp_echo/src | |
parent | b0c37e853ef0600ca5b86216e427d767b6bc6126 (diff) | |
download | ranch-0770e2893f88cd50020a621e4d3b813ff8e6c58f.tar.gz ranch-0770e2893f88cd50020a621e4d3b813ff8e6c58f.tar.bz2 ranch-0770e2893f88cd50020a621e4d3b813ff8e6c58f.zip |
Fix small issues and style of the examples
Diffstat (limited to 'examples/tcp_echo/src')
-rw-r--r-- | examples/tcp_echo/src/echo_protocol.erl | 5 | ||||
-rw-r--r-- | examples/tcp_echo/src/tcp_echo.app.src | 4 | ||||
-rw-r--r-- | examples/tcp_echo/src/tcp_echo.erl | 12 |
3 files changed, 6 insertions, 15 deletions
diff --git a/examples/tcp_echo/src/echo_protocol.erl b/examples/tcp_echo/src/echo_protocol.erl index 85ea289..5ed79b3 100644 --- a/examples/tcp_echo/src/echo_protocol.erl +++ b/examples/tcp_echo/src/echo_protocol.erl @@ -1,7 +1,10 @@ %% Feel free to use, reuse and abuse the code in this file. -module(echo_protocol). --export([start_link/4, init/4]). +-behaviour(ranch_protocol). + +-export([start_link/4]). +-export([init/4]). start_link(Ref, Socket, Transport, Opts) -> Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]), diff --git a/examples/tcp_echo/src/tcp_echo.app.src b/examples/tcp_echo/src/tcp_echo.app.src index 103fd56..af50890 100644 --- a/examples/tcp_echo/src/tcp_echo.app.src +++ b/examples/tcp_echo/src/tcp_echo.app.src @@ -1,10 +1,10 @@ %% Feel free to use, reuse and abuse the code in this file. {application, tcp_echo, [ - {description, "Ranch TCP Echo example."}, + {description, "Ranch TCP echo example."}, {vsn, "1"}, {modules, []}, - {registered, []}, + {registered, [tcp_echo_sup]}, {applications, [ kernel, stdlib, diff --git a/examples/tcp_echo/src/tcp_echo.erl b/examples/tcp_echo/src/tcp_echo.erl deleted file mode 100644 index 46d31da..0000000 --- a/examples/tcp_echo/src/tcp_echo.erl +++ /dev/null @@ -1,12 +0,0 @@ -%% Feel free to use, reuse and abuse the code in this file. - --module(tcp_echo). - -%% API. --export([start/0]). - -%% API. - -start() -> - ok = application:start(ranch), - ok = application:start(tcp_echo). |