Changed socket server to output stream