sockets de bordo no linux

1

Eu estava verificando código de sendmsg chamada do sistema para AF_UNIX socket, ai eu encontro uma função: wait_for_unix_gc (um garbage collector de sockets de bordo). Alguém pode informar o que são essas tomadas de bordo?

Arquivo do Kernel: linux/net/unix/garbage.c

    
por Saturn 22.08.2016 / 15:57

1 resposta

1

Copie apenas da programação de rede Unix V1: Capítulo 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.

    
por 07.09.2016 / 10:35