aboutsummaryrefslogblamecommitdiffstats
path: root/test/check_tcp_options.erl
blob: 18432acbe94261603b6154bb0cdd2964f1cd1b34 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.