From 5ada450fe10a5fc51b7f3f0900571a10547635a1 Mon Sep 17 00:00:00 2001 From: "j.uhlig" Date: Tue, 26 Jun 2018 17:07:13 +0200 Subject: Introduce Transport:handshake/1,2 This commit deprecates Transport:accept_ack/1 in favor of a new forward-compatible function. Transport:handshake/1,2 will use ssl:handshake/2,3 from Ranch 2.0 onward. --- test/trap_exit_protocol.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/trap_exit_protocol.erl') diff --git a/test/trap_exit_protocol.erl b/test/trap_exit_protocol.erl index a0c4329..6100075 100644 --- a/test/trap_exit_protocol.erl +++ b/test/trap_exit_protocol.erl @@ -2,15 +2,15 @@ -behaviour(ranch_protocol). -export([start_link/4]). --export([init/4]). +-export([init/3]). -start_link(Ref, Socket, Transport, Opts) -> - Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]), +start_link(Ref, _Socket, Transport, Opts) -> + Pid = spawn_link(?MODULE, init, [Ref, Transport, Opts]), {ok, Pid}. -init(Ref, Socket, Transport, _Opts = []) -> +init(Ref, Transport, _Opts = []) -> process_flag(trap_exit, true), - ok = ranch:accept_ack(Ref), + {ok, Socket} = ranch:handshake(Ref), loop(Socket, Transport). loop(Socket, Transport) -> -- cgit v1.2.3