1

I was checking code of sendmsg system call for AF_UNIX socket, there I find one function: wait_for_unix_gc ( a garbage collector of inflight sockets). Can anyone brief what these inflight sockets are?

Kernel File: linux/net/unix/garbage.c

1 Answer 1

1

Just copy from Unix network programming V1: Chapter 15.7

The sending process builds a msghdr structure (Section 14.5) containing the descriptor to be passed. POSIX specifies that the descriptor be sent as ancillary data (the msg_control member of the msghdr structure, Section 14.6), but older implementations use the msg_accrights member. The sending process calls sendmsg to send the descriptor across the Unix domain socket from Step 1. At this point, we say that the descriptor is "in flight." Even if the sending process closes the descriptor after calling sendmsg, but before the receiving process calls recvmsg (in the next step), the descriptor remains open for the receiving process. Sending a descriptor increments the descriptor's reference count by one.

1
  • Is'nt it a description for in flight descriptor??? rather than in flight sockets... but anyway can we guess similar concept for in flight socket?? thanks for answering Commented Sep 7, 2016 at 10:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.