code cleanup and making sockstreambuf::flush() public