On Apr 13, 2:49 am, Stefan Eilemann <[email protected]> wrote:
> Morning,
>
> It seems in the second case the connection to the server fails and
> your program exits directly, since the server is destroyed.
>
> There must be a difference between the two cases, but I can't spot it
> now. Can you try:
>
> 1) with eqPly

eqPly runs just fine with my configuration file.  (as does eqHello).
Since I need to separate the appNode from the rendering nodes (appNode
is a plugin to another software) I have the server, appNode, and a
node on the localhost.  it all runs fine.

> 2) Comparing your code with eq::getConfig (lib/client/init.cpp) or eqPly

Here is my initialization code in more detail.  It's pretty much eqPly
verbatim.  I've replaced step 5 in main.cpp with the actual lines from
eqPly->run().


        // 1. Setup False Arguments for Plug-In
        NSLog(@"Loading eqOsirix plug-in");

        // Build "command-line" inputs for Configurations of _config and
nodeFactory
        const int argc = 1; //Test with default config for right now.  Ignore
"--eq-config filename"
        NSString *path = [[NSWorkspace sharedWorkspace]
                                                                                
fullPathForApplication:@"Osirix"];
        NSString *eqconfig = @"--eq-config";
        NSString *configPath = @"/Users/slate/Documents/equalizer/build/4p.
1n.sw.eqc";//XCode/share/Equalizer/configs/4p.fs.eqc";
        char *argv[] = {(char *)[path cStringUsingEncoding:1]
                , (char *)[eqconfig cStringUsingEncoding:1]
                , (char *)[configPath cStringUsingEncoding:1]
        };

        // 2. Redirect log output to file, if requested
        std::ofstream* logFile = 0;
        const std::string& logFilename ("~/log.txt");//
initData.getLogFilename();
        if( !logFilename.empty( ))
        {
                logFile = new ofstream( logFilename.c_str( ));
                //eq::base::Log::setOutput( *logFile );
        }

        // 3. Equalizer initialization
        eqOsirix::NodeFactory nodeFactory;
        if( !eq::init( argc, argv, &nodeFactory ))
        {
                EQERROR << "Equalizer init failed" << endl;
                return;// EXIT_FAILURE;
        }

        //uncomment to test eq::Config creation
        //eqOsirix::Config* _config = static_cast< eqOsirix::Config* >
(eq::getConfig( argc, argv));


        // 4. initialization of local client node
        eq::base::RefPtr<eqOsirix::EqOsirix> client = new
eqOsirix::EqOsirix( );
        [self set_client:client];
        if( ![self _client]->initLocal( argc, argv ))
        {
                EQERROR << "Can't init client" << endl;
                eq::exit();
                return;// EXIT_FAILURE;
        }

        // 5. run client
        // TODO:: Run in new thread!?
        //const int ret = [self _client]->run();

        /** Debugging */

        // 5.1. connect to server
        ServerPtr _server = new eq::Server;
        if( ![self _client]->connectServer( _server )) //<--- Program Hangs
here
        {
                EQERROR << "Can't open server" << endl;
                return;// EXIT_FAILURE;
        }

        // 5.2. choose config
        eq::ConfigParams configParams;
        configParams.setRenderClient("/Users/slate/Documents/osirixplugins/
eqOsirix/build/Development/rcOsirix.app/Contents/MacOS/rcOsirix");
        eqOsirix::Config *_config = static_cast<eqOsirix::Config*>(_server-
>chooseConfig( configParams ));

        if( !_config )
        {
                EQERROR << "No matching config on server" << endl;
                [self _client]->disconnectServer( _config->getServer() );
                return;// EXIT_FAILURE;
        }

        // 5.3. init config

        //_config->setInitData( _initData );
        if( !_config->init( ))
        {
                EQERROR << "Config initialization failed: "
                << _config->getErrorMessage() << endl;
                _config->getServer()->releaseConfig( _config );
                [self _client]->disconnectServer( _config->getServer() );
                return;// EXIT_FAILURE;
        }

        [self _client]->setConfig(_config);
        //*/

> 3) stepping through Client::connectServer
>
> to see what is going wrong?

The line:
if( connect( net::NodePtr(server.get()))) {
never returns.

Stepping through Node::connect(NodePtr), the line initConnect(NodePtr)
returns false (cds has one object: "localhost:4743", connection-
>connect() fails and autolaunch is false.

Node::connect(NodePtr) then sends the error message, returns false,
but never exits the function.  it just hangs on the closing "}"

If I add the line of code
  eqOsirix::Config* _config2 = static_cast< eqOsirix::Config* >
(eq::getConfig( argc, argv));

before step 4. above (i.e. use eq::getConfig()) then the
initConnect(NodePtr) still returns false (connection->connect() fails
and autolaunch is false) but the program returns from
Node::connect(NodePtr) just fine and continues executing.

Thanks for the help!

-Stephen

_______________________________________________
eq-dev mailing list
[email protected]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

Reply via email to