I'm new to working with forking and I am having a trouble understanding how to achieve what I want. I'll try to explain as best I can.

I have Process A which is a functional Berkeley socket server running on Linux.

I need Process A to load a program from the disk into a separate non-blocking process (Process B) in a background state. Then Process A needs to pass Process B control of Process A's sockets. Lastly Process A needs to end, leaving process B running.

I'm unclear on whats needed to pass the sockets to a new process if the old one ends, and the best way to create a non-blocking new process that allows the original process to end.