Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: cd099983b1
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (16 sloc) 0.448 kb
-module(remove_conn_and_wait_protocol).
-behaviour(ranch_protocol).
-export([start_link/4]).
-export([init/2]).
start_link(ListenerPid, _, _, [{remove, MaybeRemove}]) ->
Pid = spawn_link(?MODULE, init, [ListenerPid, MaybeRemove]),
{ok, Pid}.
init(ListenerPid, MaybeRemove) ->
ranch:accept_ack(ListenerPid),
case MaybeRemove of
true ->
ranch_listener:remove_connection(ListenerPid);
false ->
ok
end,
receive after 2500 -> ok end.
Jump to Line
Something went wrong with that request. Please try again.