Skip to content

Commit

Permalink
Use erpc:call instead of custom call mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
juhlig committed Jul 4, 2024
1 parent 7a3aa3b commit de6d4b6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/ranch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,7 @@ start_error(_, Error) -> Error.

-spec stop_listener(ref()) -> ok | {error, not_found}.
stop_listener(Ref) ->
Parent = self(),
Tag = make_ref(),
{StopperPid, StopperMon} = spawn_monitor(fun() -> Parent ! {Tag, stop_listener1(Ref)} end),
receive
{Tag, Result} ->
demonitor(StopperMon, [flush]),
Result;
{'DOWN', StopperMon, process, StopperPid, Error} ->
{error, Error}
end.
erpc:call(node(), fun() -> stop_listener1(Ref) end, 5000).

stop_listener1(Ref) ->
TransportAndOpts = maybe_get_transport_and_opts(Ref),
Expand Down

0 comments on commit de6d4b6

Please sign in to comment.