Redirect server

For workflows driven by Maple or MATLAB, Julia can run a loop that reads a package name and function name from the channel, loads the package in Main, and dispatches to that function. This is how PACE.jl serves remote calls to its own functions.

Entry points

FunctionPurpose
start_redirect_serverConnects as client to localhost:port, then runs handle_request in a loop.
handle_requestReads two strings (package, function), loads the package, calls func(channel).
ensure_package_loadedusing PackageName in Main if not already loaded.
read_string / write_stringLength-prefixed string I/O on the channel.

Protocol (per request)

  1. Read package name (string). Empty string → connection closed; the server may exit.
  2. Read function name (string).
  3. Call Main.PackageName.function_name(channel) — the callee reads/writes further data on channel and should flush as needed.

Starting from the command line

julia -e 'using UDX; UDX.start_redirect_server(Int32(PORT))'

Replace PORT with the TCP port number (an integer, e.g. 45123) on which the UDX listener is already running. Julia must connect to the same port that Maple, MATLAB, or another UDX client opened as the server and printed to you.