[kwlug-disc] Question about ... sockets?

Doug Moen doug at moens.org
Tue Feb 2 15:46:57 EST 2021


I've done this in C using fork() and pipe().
>From the Linux shell, type
  $ man 2 pipe
and there is an example C program that does just what you want.
</doug>

On Tue, Feb 2, 2021, at 11:18 AM, Mikalai Birukou via kwlug-disc wrote:
> A need/want:
> 
> I want process to start some other process, giving it some way to 
> communicate with creator process. This communication should be only 
> between these two running processes, i.e. kernel help us here.
> 
> 
> My currently limited understanding:
> 
>   - Everyone do something that sounds precisely like this, e.g. 
> communication between Electron main and renderrer processes. It feels, 
> that I am missing some fundamental understanding here.
> 
>   - When you grew out of user land, you encounter suggestions like 
> socket on localhost:port and unix socket on some path. Localhost:port is 
> not ok, cause everyone on the machine can connect. Unix socket has 
> protection on path with privileges. But I want a connection between two 
> specific processes only. In fact, if connection is dropped, created 
> process should close as well. Hacking thought within this limited choice 
> is make a path, start to listen, when created process connects, unlink 
> that path. But can I pass an open connection, and only it?
> 
>   - How should process be started so that it isn't given implicitly any 
> resources from initializing process, only passing explicitly particular 
> open connection(s)? I head fork is making copies of descriptors :/ ? Is 
> there other way? Can someone explain this, or give links to 
> userland-parsable resources/docs?
> 
> 
> Thank you.
> 
> 
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>




More information about the kwlug-disc mailing list