diff options
author | Loïc Hoguin <[email protected]> | 2013-12-07 13:53:00 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-12-07 13:53:00 +0100 |
commit | b0c37e853ef0600ca5b86216e427d767b6bc6126 (patch) | |
tree | f25ccf1af5d97df4665aa7bc3477592f7f59e3f2 /examples/tcp_echo | |
parent | 7194df4568e66c1f2fee86816ace3308ec9eb302 (diff) | |
parent | 4e5e04f66869d2a34b8d32232e1bbb0e813befba (diff) | |
download | ranch-b0c37e853ef0600ca5b86216e427d767b6bc6126.tar.gz ranch-b0c37e853ef0600ca5b86216e427d767b6bc6126.tar.bz2 ranch-b0c37e853ef0600ca5b86216e427d767b6bc6126.zip |
Merge branch 'tcp_echo_example_updates' of git://github.com/joshrotenberg/ranch
Diffstat (limited to 'examples/tcp_echo')
-rw-r--r-- | examples/tcp_echo/Makefile | 6 | ||||
-rw-r--r-- | examples/tcp_echo/README.md | 23 | ||||
-rw-r--r-- | examples/tcp_echo/relx.config | 2 | ||||
-rwxr-xr-x | examples/tcp_echo/start.sh | 3 |
4 files changed, 22 insertions, 12 deletions
diff --git a/examples/tcp_echo/Makefile b/examples/tcp_echo/Makefile new file mode 100644 index 0000000..712ae19 --- /dev/null +++ b/examples/tcp_echo/Makefile @@ -0,0 +1,6 @@ +PROJECT = tcp_echo + +DEPS = ranch +dep_ranch = pkg://ranch 0.9.0 + +include ../../erlang.mk diff --git a/examples/tcp_echo/README.md b/examples/tcp_echo/README.md index ee8a8c8..df4c6bd 100644 --- a/examples/tcp_echo/README.md +++ b/examples/tcp_echo/README.md @@ -1,18 +1,23 @@ Ranch TCP Echo ============== -To compile this example you need rebar in your PATH. - -Type the following command: -``` -$ rebar get-deps compile +To build the example: +``` bash +$ make ``` -You can then start the Erlang node with the following command: +To start the release in the foreground: + +``` bash +$ ./_rel/bin/tcp_echo_example console ``` -./start.sh + +Then start a telnet session to port 5555: +``` bash +$ telnet localhost 5555 ``` -Then start telnet as indicated and type in a few lines. Be -aware that there is a timeout of 5 seconds without receiving +Type in a few words and see them echoed back. + +Be aware that there is a timeout of 5 seconds without receiving data before the example server disconnects your session. diff --git a/examples/tcp_echo/relx.config b/examples/tcp_echo/relx.config new file mode 100644 index 0000000..a850b71 --- /dev/null +++ b/examples/tcp_echo/relx.config @@ -0,0 +1,2 @@ +{release, {tcp_echo_example, "1"}, [tcp_echo]}. +{extended_start_script, true}. diff --git a/examples/tcp_echo/start.sh b/examples/tcp_echo/start.sh deleted file mode 100755 index 925cf36..0000000 --- a/examples/tcp_echo/start.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -erl -pa ebin deps/*/ebin -s tcp_echo \ - -eval "io:format(\"Run: telnet localhost 5555~n\")." |