aboutsummaryrefslogtreecommitdiffstats
path: root/test/check_tcp_options.erl
diff options
context:
space:
mode:
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.