went back to 2 streams
replaced file stream with socket