add missing pid parameter to writeData
Implement a big bundle of more socket code
speed up do_read and openFile