diff options
Diffstat (limited to 'src/ranch_acceptors_sup.erl')
-rw-r--r-- | src/ranch_acceptors_sup.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ranch_acceptors_sup.erl b/src/ranch_acceptors_sup.erl index 963b4d3..5617873 100644 --- a/src/ranch_acceptors_sup.erl +++ b/src/ranch_acceptors_sup.erl @@ -36,6 +36,8 @@ start_link(NbAcceptors, Transport, TransOpts, init([NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts, ListenerPid, ConnsPid]) -> {ok, LSocket} = Transport:listen(TransOpts), + {ok, {_, Port}} = Transport:sockname(LSocket), + ranch_listener:set_port(ListenerPid, Port), Procs = [{{acceptor, self(), N}, {ranch_acceptor, start_link, [ LSocket, Transport, Protocol, ProtoOpts, ListenerPid, ConnsPid |