I am building a server application (targeting Unix-like systems) that will receive payloads from clients only on the same machine. Clients will send a request and get a response back with possibility of sending a subsequent request based on what server responded.
What's the best/recommended mechanism to do this? I have been playing around with Unix-domain sockets but I have seen projects that actually use a local web server to receive http requests.
If I am not mistaking, racer uses stdin/command line arguments to achieve something similar.
In my case speed & latency are important so that's why I've been tinkering with sockets.
What's your preferred way of doing this in you Rust projects?
I have used Unix pipes for this purpose. If your server starts the clients, it can hand each one an anonymous pipe. Otherwise, you can use named pipes.
yea, have to used named pipes since server cant do that.
have you been able to run a Rust program in background as a daemon and when another application tries to launch it again we just send the input arguments to the background process and force it to process them instead of relaunching a new copy of it?