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
| Function | Purpose |
|---|---|
start_redirect_server | Connects as client to localhost:port, then runs handle_request in a loop. |
handle_request | Reads two strings (package, function), loads the package, calls func(channel). |
ensure_package_loaded | using PackageName in Main if not already loaded. |
read_string / write_string | Length-prefixed string I/O on the channel. |
Protocol (per request)
- Read package name (string). Empty string → connection closed; the server may exit.
- Read function name (string).
- Call
Main.PackageName.function_name(channel)— the callee reads/writes further data onchanneland 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.