tcp server js and write file stream