Reputation: 283
file descriptor can be passed from one process to the other on the same host using UNIX domain socket. can someone please tell if there is a way to pass file descriptor between processes on different host??
Upvotes: 1
Views: 719
Reputation: 136208
There is no way to pass a file descriptor between processes on different host.
The reason being is that a file descriptor is a reference to a file description structure in the kernel. When you pass a file descriptor to another process on the same host, that process just refers the same existing file description in the kernel. Whereas, that same file description doesn't exist in the kernel of another host.
Upvotes: 5
Reputation: 409136
A file descriptor is basically an index into a set of tables on the local computer, so there is no way another computer can use the same file descriptor.
Upvotes: 1
Reputation: 363487
There's no way to pass a file descriptor to a remote process. How could there be? A file descriptor refers to an I/O resource provided by the local machine (even if it's a network socket, because then the socket refers to a network connection involving the local machine), which may not be available on the remote host.
Upvotes: 3