Skip to content

Commit ec3f988

Browse files
committed
wip
1 parent 5a38d08 commit ec3f988

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/NetworkInterfaceControllers.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ function broker_startup_string(ipv::Int)::String
8484
return "$(runtime_str) -e '$(import_str); $(query_str) |> last |> wait'"
8585
end
8686

87+
broker_startup_string() = broker_startup_string(4)
88+
8789
function broker_query_string(ip::String, port::Int)::String
8890
runtime_str = julia_runtime_str()
8991
import_str = "using NetworkInterfaceControllers.Broker, Sockets"
@@ -103,6 +105,19 @@ end
103105
function best_interface_broker(
104106
data::Interface; broker_port::Union{T, Nothing}=nothing
105107
) where T <: Integer
108+
109+
if isnothing(broker_port)
110+
@debug "Getting broker port from NICPreferences.BROKER_INTERFACE"
111+
broker_port = NICPreferences.BROKER_INTERFACE.port
112+
@assert !isnothing(broker_port)
113+
end
114+
115+
# Default to `localhost` if a suitable environment variable containing the
116+
# broker address is not set
117+
broker_addr = "localhost"
118+
for env_add in NICPreferences.BROKER_HOST_ENV
119+
end
120+
106121
end
107122

108123
function best_interfaces(data::Vector{Interface})

src/nic_preferences.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ const _broker_mode_default = setting(:mode, USE_DISABLED)
169169
const _broker_interface_default = setting(:interface, ".*", MATCH_REGEX, 3000)
170170
const _broker_mode = @load_preference("broker_mode")
171171
const _broker_interface = @load_preference("broker_interface")
172-
const BORKER_HOST_ENV = @load_preference("broker_host_env")
172+
const BORKER_HOST_ENV = @load_preference("broker_host_env", [])
173173

174174
const NAME_SELECTOR = ModeSettings(@val_or_default(:_name_selector_mode))
175175
const HWLOC_SELECTOR = ModeSettings(@val_or_default(:_hwloc_selector_mode))

0 commit comments

Comments
 (0)