|
@@ -38,10 +38,10 @@ in `examples/tcp_echo/`.
|
|
-module(echo_protocol).
|
|
-module(echo_protocol).
|
|
-behaviour(ranch_protocol).
|
|
-behaviour(ranch_protocol).
|
|
|
|
|
|
--export([start_link/4]).
|
|
|
|
|
|
+-export([start_link/3]).
|
|
-export([init/3]).
|
|
-export([init/3]).
|
|
|
|
|
|
-start_link(Ref, _Socket, Transport, Opts) ->
|
|
|
|
|
|
+start_link(Ref, Transport, Opts) ->
|
|
Pid = spawn_link(?MODULE, init, [Ref, Transport, Opts]),
|
|
Pid = spawn_link(?MODULE, init, [Ref, Transport, Opts]),
|
|
{ok, Pid}.
|
|
{ok, Pid}.
|
|
|
|
|
|
@@ -80,11 +80,11 @@ the normal `gen_statem` execution loop.
|
|
-behaviour(gen_statem).
|
|
-behaviour(gen_statem).
|
|
-behaviour(ranch_protocol).
|
|
-behaviour(ranch_protocol).
|
|
|
|
|
|
--export([start_link/4]).
|
|
|
|
|
|
+-export([start_link/3]).
|
|
-export([init/1]).
|
|
-export([init/1]).
|
|
%% Exports of other gen_statem callbacks here.
|
|
%% Exports of other gen_statem callbacks here.
|
|
|
|
|
|
-start_link(Ref, _Socket, Transport, Opts) ->
|
|
|
|
|
|
+start_link(Ref, Transport, Opts) ->
|
|
{ok, proc_lib:spawn_link(?MODULE, init, [{Ref, Transport, Opts}])}.
|
|
{ok, proc_lib:spawn_link(?MODULE, init, [{Ref, Transport, Opts}])}.
|
|
|
|
|
|
init({Ref, Transport, _Opts = []}) ->
|
|
init({Ref, Transport, _Opts = []}) ->
|