Skip to content

Commit

Permalink
optimize porthint in known range
Browse files Browse the repository at this point in the history
  • Loading branch information
amitmurthy committed Dec 16, 2017
1 parent b389c92 commit 2ec9145
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stdlib/Distributed/src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ function start_worker(out::IO, cookie_in::Nullable{AbstractString})
init_worker(cookie)
interface = IPv4(LPROC.bind_addr)
if LPROC.bind_port == 0
(port, sock) = listenany(interface, UInt16(0))
port_hint = 9000 + (getpid() % 1000)
(port, sock) = listenany(interface, UInt16(port_hint))
LPROC.bind_port = port
else
sock = listen(interface, LPROC.bind_port)
Expand Down

0 comments on commit 2ec9145

Please sign in to comment.