netLocalAddress (Function)

Signature: netLocalAddress(host: string, port: int) -> string

Description: The local address that routes to a host, or "" when none does. Sends nothing.

Parameters

  • host (string): The remote host
  • port (int): Any UDP port used to pick the route

Returns: string

Example

let address = netLocalAddress("127.0.0.1", 9)
let port = fileServerStart("song.mp3", "audio/mpeg", address)
print(if port > 0 { "serving on ${port}; stopped=${fileServerStop(port)}" } else { "not served: ${port}" })
address = netLocalAddress ("127.0.0.1", 9)
port = fileServerStart ("song.mp3", "audio/mpeg", address)
print (if port > 0 { "serving on ${port}; stopped=${fileServerStop(port)}" } else ["not served => ${port}"])