Discussion:
[omniORB] how to catch COMM_FAILURE exception
Aida Fátima Cano
2007-02-06 17:48:13 UTC
Permalink
I have the following code: A Client sends a request to a server (Method_1);
then, this server, workins as a client, makes a request to another Server.

Why the application, in debug mode, doesn't reach the catch statments If,
while waiting method_2 to return, TCP communications fail?


CORBA::Boolean CDT_CS_Request_i::Method_1()
{
try
{
CCS_DT_Request cesionRequestObj();
aceptado = cesionRequestObj.Method_2();
}
catch(CORBA::COMM_FAILURE& ex)
{
cerr << "Caught CORBA::COMM" << endl;
return false;
}
catch(CORBA::SystemException&)
{
cerr << "Caught CORBA::SystemException." << endl;
return false;
}
catch(CORBA::Exception&) {
cerr << "Caught CORBA::Exception." << endl;
return false;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
return false;
}
catch (...)
{
}

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070206/d9a43452/attachment.htm
Duncan Grisby
2007-02-07 17:02:07 UTC
Permalink
Post by Aida Fátima Cano
I have the following code: A Client sends a request to a server (Method_1);
then, this server, workins as a client, makes a request to another Server.
Why the application, in debug mode, doesn't reach the catch statments If,
while waiting method_2 to return, TCP communications fail?
Your code should correctly catch the exception. What happens instead?
What platform and compiler are you using? Do the omniORB echo examples
work? What does eg2_clt do if you try to run it with the IOR for a
server that you have stopped? It should report a TRANSIENT exception.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Aida Fátima Cano
2007-02-07 17:54:49 UTC
Permalink
I have put a breakpoint in the line inside each catch statment and in the
return statement of the method but the ejecution never reachs them.

I'm working under windows, using Microsoft Visual C++ compiler (version 6.0
).

I've prove if the code catchs any exception if I stop the server, and it
does.

The only error I can't catch is the COMM_FAILURE. I can't follow the thread
since th net falls down, so I don't know if these threads are still alive or
not.

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070207/33f026da/attachment.htm
Duncan Grisby
2007-02-27 17:20:43 UTC
Permalink
Post by Aida Fátima Cano
I have put a breakpoint in the line inside each catch statment and in the
return statement of the method but the ejecution never reachs them.
I'm working under windows, using Microsoft Visual C++ compiler (version 6.0
).
I've prove if the code catchs any exception if I stop the server, and it
does.
The only error I can't catch is the COMM_FAILURE. I can't follow the thread
since th net falls down, so I don't know if these threads are still alive or
not.
There's nothing different about COMM_FAILURE compared to any of the
other exceptions that are thrown. Something is obviously wrong with your
C++ runtime environment, causing it to miss the exception. Check that
your compile options match the options that omniORB's examples use.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Continue reading on narkive:
Loading...