Skip to content

Commit 175dbfb

Browse files
dumbbellmichaelklishin
authored andcommitted
tcp_listener_sup: Switch to ranch:child_spec/5
ranch:child_spec/6 is deprecated. (cherry picked from commit 9920cea)
1 parent 6a9eb18 commit 175dbfb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/tcp_listener_sup.erl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ init({IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartup, On
5050
ConcurrentAcceptorCount, Label}) ->
5151
{ok, AckTimeout} = application:get_env(rabbit, ssl_handshake_timeout),
5252
MaxConnections = rabbit_misc:get_env(rabbit, connection_max, infinity),
53+
RanchListenerOpts = #{
54+
num_acceptors => ConcurrentAcceptorCount,
55+
max_connections => MaxConnections,
56+
handshake_timeout => AckTimeout,
57+
connection_type => supervisor,
58+
socket_opts => [{ip, IPAddress},
59+
{port, Port} |
60+
SocketOpts]
61+
},
5362
{ok, {{one_for_all, 10, 10}, [
54-
ranch:child_spec({acceptor, IPAddress, Port}, ConcurrentAcceptorCount,
55-
Transport, [{port, Port}, {ip, IPAddress},
56-
{max_connections, MaxConnections},
57-
{ack_timeout, AckTimeout},
58-
{connection_type, supervisor}|SocketOpts],
63+
ranch:child_spec({acceptor, IPAddress, Port},
64+
Transport, RanchListenerOpts,
5965
ProtoSup, ProtoOpts),
6066
{tcp_listener, {tcp_listener, start_link,
6167
[IPAddress, Port,

0 commit comments

Comments
 (0)