Skip to content

Commit 8539740

Browse files
committed
DaggerWebDash: Use gethostname
1 parent 6c91727 commit 8539740

File tree

1 file changed

+6
-2
lines changed
  • lib/DaggerWebDash/src

1 file changed

+6
-2
lines changed

lib/DaggerWebDash/src/d3.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const D3R_ACTUAL_PORT = Dict{Int,Int}()
5757
# TODO: Concrete socket types
5858
const D3R_CLIENT_SOCKETS = Dict{Int,Dict{Int,Vector{Any}}}()
5959

60-
const D3R_WORKER_HOST_MAP = Dict{Int,IPAddr}()
60+
const D3R_WORKER_HOST_MAP = Dict{Int,Union{IPAddr,String}}()
6161
const D3R_WORKER_PORT_MAP = Dict{Int,Int}()
6262

6363
struct D3Renderer
@@ -311,7 +311,11 @@ end
311311
function worker_host_port(id::Int, port::Int, port_range::UnitRange)
312312
worker_host = get!(D3R_WORKER_HOST_MAP, port) do
313313
worker_host, worker_port = remotecall_fetch(id, port) do port
314-
(MemPool.host, get_actual_port(port, port_range))
314+
host = gethostname()
315+
if isempty(host)
316+
host = getipaddr()
317+
end
318+
(host, get_actual_port(port, port_range))
315319
end
316320
D3R_WORKER_PORT_MAP[port] = worker_port
317321
worker_host

0 commit comments

Comments
 (0)