Fork server communication into thread and wait for termination