From 3ea575d8682560fc02d5583cbf2837e2f2f43e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 9 May 2019 10:43:25 +0200 Subject: Remove Socket argument from ranch_protocol:start_link --- doc/src/guide/protocols.asciidoc | 8 ++++---- doc/src/manual/ranch.handshake.asciidoc | 5 ----- doc/src/manual/ranch_protocol.asciidoc | 8 ++++---- 3 files changed, 8 insertions(+), 13 deletions(-) (limited to 'doc') diff --git a/doc/src/guide/protocols.asciidoc b/doc/src/guide/protocols.asciidoc index 8f77ef4..89360ef 100644 --- a/doc/src/guide/protocols.asciidoc +++ b/doc/src/guide/protocols.asciidoc @@ -38,10 +38,10 @@ in `examples/tcp_echo/`. -module(echo_protocol). -behaviour(ranch_protocol). --export([start_link/4]). +-export([start_link/3]). -export([init/3]). -start_link(Ref, _Socket, Transport, Opts) -> +start_link(Ref, Transport, Opts) -> Pid = spawn_link(?MODULE, init, [Ref, Transport, Opts]), {ok, Pid}. @@ -80,11 +80,11 @@ the normal `gen_statem` execution loop. -behaviour(gen_statem). -behaviour(ranch_protocol). --export([start_link/4]). +-export([start_link/3]). -export([init/1]). %% 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}])}. init({Ref, Transport, _Opts = []}) -> diff --git a/doc/src/manual/ranch.handshake.asciidoc b/doc/src/manual/ranch.handshake.asciidoc index c8a6ee9..5d2694c 100644 --- a/doc/src/manual/ranch.handshake.asciidoc +++ b/doc/src/manual/ranch.handshake.asciidoc @@ -24,11 +24,6 @@ handshake necessary to give control of the socket to this process and also does the transport handshake, for example setting up the TLS connection. -Currently the socket can be obtained from a -`Protocol:start_link/4` argument and as a return value -from `ranch:handshake/1,2`. In Ranch 2.0 the socket will -only be available from `ranch:handshake/1,2`. - == Arguments Ref:: diff --git a/doc/src/manual/ranch_protocol.asciidoc b/doc/src/manual/ranch_protocol.asciidoc index 8e8c0e0..5a94399 100644 --- a/doc/src/manual/ranch_protocol.asciidoc +++ b/doc/src/manual/ranch_protocol.asciidoc @@ -16,7 +16,6 @@ Ranch protocols implement the following interface: [source,erlang] ---- start_link(Ref :: ranch:ref(), - _, Transport :: module(), ProtoOpts :: any()) -> {ok, ConnPid :: pid()} @@ -46,9 +45,10 @@ processes and degrade performance severely. == Changelog -* *1.6*: The second argument `Socket` was deprecated and will - be removed in Ranch 2.0. The socket should be obtained - by calling link:man:ranch:handshake(3)[ranch:handshake(3)]. +* *2.0*: The second argument `Socket` was removed. +* *1.6*: The second argument `Socket` was deprecated. Call + link:man:ranch:handshake(3)[ranch:handshake(3)] + to obtain the socket. == See also -- cgit v1.2.3