Reordered command line parsing and replace throw with cout.
This commit is contained in:
parent
e2d4ebbe55
commit
a6baf00956
@ -402,6 +402,20 @@ int main( int argc, char **argv )
|
||||
|
||||
|
||||
|
||||
std::string address;
|
||||
std::string port;
|
||||
|
||||
while (arguments.read("--address", address)) {}
|
||||
while (arguments.read("--port", port)) {}
|
||||
|
||||
bool use_zeroconf(false);
|
||||
bool use_sender(false);
|
||||
bool use_receiver(false);
|
||||
if(arguments.find("--zeroconf") > 0) { use_zeroconf = true; }
|
||||
if(arguments.find("--sender") > 0) { use_sender = true; }
|
||||
if(arguments.find("--receiver") > 0) { use_receiver = true; }
|
||||
|
||||
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
|
||||
|
||||
@ -414,18 +428,6 @@ int main( int argc, char **argv )
|
||||
scene = geode;
|
||||
}
|
||||
|
||||
std::string address;
|
||||
std::string port;
|
||||
|
||||
bool use_zeroconf(false);
|
||||
bool use_sender(false);
|
||||
bool use_receiver(false);
|
||||
if(arguments.find("--zeroconf") > 0) { use_zeroconf = true; }
|
||||
if(arguments.find("--sender") > 0) { use_sender = true; }
|
||||
if(arguments.find("--receiver") > 0) { use_receiver = true; }
|
||||
|
||||
while (arguments.read("--address", address)) {}
|
||||
while (arguments.read("--port", port)) {}
|
||||
|
||||
// construct the viewer.
|
||||
osgViewer::CompositeViewer viewer(arguments);
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <math.h>
|
||||
@ -185,7 +186,9 @@ public:
|
||||
{
|
||||
std::string errorString("error when calling send : ");
|
||||
errorString += strerror(errno);
|
||||
throw std::runtime_error(errorString);
|
||||
|
||||
std::cout<<errorString<<std::endl;
|
||||
// throw std::runtime_error(errorString);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user