[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: socketpairs
From: |
Catonano |
Subject: |
Re: socketpairs |
Date: |
Thu, 7 Feb 2019 12:58:32 +0100 |
Il giorno gio 7 feb 2019 alle ore 12:32 Mike Gran <address@hidden> ha
scritto:
>
> Unix sockets are often used to communicate between processes on the same
> machine.
>
> Normally one process opens the socket and the other connects to it.
>
> Both processes need to know the unix path to the socket
> for this to work and they got to open and connect in the right order.
>
> With socketpair, a master process can make the connection and then spawn
> the child processes,
> passing them the file descriptors of the sockets, so the
> child processes don't have to have any networking code.
>
> Commonly, one of the child processes will be spawned such
> that this file descriptor is its stdout standard output port, so
> then the child just writes to standard output, and that gets sent over the
> socket.
>
Ah so in this scenario I would control all the processes using such sockets
Than you ! 🙏