mandeep
mandeep

Reputation: 283

passing file descriptor over internet socket

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

Answers (3)

Maxim Egorushkin
Maxim Egorushkin

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

Some programmer dude
Some programmer dude

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

Fred Foo
Fred Foo

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

Related Questions