aboutsummaryrefslogtreecommitdiffstats
path: root/test/check_tcp_options.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-06-03 13:39:34 +0200
committerLoïc Hoguin <[email protected]>2014-06-03 13:39:34 +0200
commitbde897599927c354f942ca74be40d21c6734c768 (patch)
tree2844e50eee82f3b6ab77b8ca24d31f6671d72a6c /test/check_tcp_options.erl
parenta224a9b5b1e485ccfbd826bd2e03054379d3e94e (diff)
parentbac2faea84357980ce20d5ebcaa34f0550e0447a (diff)
downloadranch-bde897599927c354f942ca74be40d21c6734c768.tar.gz
ranch-bde897599927c354f942ca74be40d21c6734c768.tar.bz2
ranch-bde897599927c354f942ca74be40d21c6734c768.zip
Merge branch 'fix_inherit' of git://github.com/nevar/ranch
Diffstat (limited to 'test/check_tcp_options.erl')
-rw-r--r--test/check_tcp_options.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/check_tcp_options.erl b/test/check_tcp_options.erl
new file mode 100644
index 0000000..18432ac
--- /dev/null
+++ b/test/check_tcp_options.erl
@@ -0,0 +1,15 @@
+-module(check_tcp_options).
+-behaviour(ranch_protocol).
+
+-export([start_link/4]).
+-export([init/3]).
+
+start_link(_, Socket, _, [{pid, TestPid}|TcpOptions]) ->
+ {ok, RealTcpOptions} =
+ inet:getopts(Socket, [Key || {Key, _} <- TcpOptions]),
+ Pid = spawn_link(?MODULE, init, [TestPid, RealTcpOptions, TcpOptions]),
+ {ok, Pid}.
+
+init(Pid, TcpOptions, TcpOptions) ->
+ Pid ! checked,
+ receive after 2500 -> ok end.