I’ve written a simple package for evaluating functions and passing data between Julia processes using TCP sockets.
It works pretty well, as long as the function evaluations don’t produce any errors. If the an error occurs, it won’t be printed and the listening socket breaks and needs to be restarted. The try/catch code I added doesn’t seem to be helping (no errors are ever caught).
Simplified version of the listening code:
function ipc_listen(addr::Sockets.InetAddr)
server = Sockets.listen(addr)
@async begin
socket = Sockets.accept(server)
while true
try
fun = Serialization.deserialize(socket)
args = Serialization.deserialize(socket)
@eval(Main, $fun($args...))
catch e
println(STDERR, e)
end
end
server
end
Full code is here: