Jump to content
OpenSplice DDS Forum

create_participant exits when network interface is not connected

Recommended Posts

Hi all,


I'm using OpenSplice community edition 6.4 (C++) and I'm having problems with the function create_participant (.

Our installation is configured to use a specific network interface. When this network interface is not available (e.g. ethernet cable not connected), the application exits when the function create_participant is called.

DDS::DomainParticipantFactory_var dpf = GetDomainParticipantFactoryInstace();
_osplDomainParticipantVar = dpf->create_participant(_domainId, PARTICIPANT_QOS_DEFAULT, NULL, STATUS_MASK_NONE);

The problem is that the function does not return an invalid handler (the program just crashes) and seems to not raise an exception.


In the error log I get two errors:

- eth0: does not match an available interface

- No network interface selected


How can I programmatically detect this error in order to provide a feedback to the user?

Share this post

Link to post
Share on other sites

Hi Luca


I've just done the same test (changing the NetworkInterfaceAddress to something that doesn't exist) with OpenSplice 6.4.1 and I see the same behaviour as you. 


A possible approach could be to use the ErrorInfo class (see docs) that programmatically captures errors that are logged in the ospl-error.log file.  However in this case, I'm not 100% sure whether that would work since the error hasn't been delivered up to the user API - but you could check.


I can see that there have been improvements in the area of network interface selection within OpenSplice...  I've just checked on my latest 6.6.2 Vortex OpenSplice installation and with that version the create_participant() function does return an error up to the user.



Share this post

Link to post
Share on other sites

Hi James, 


Thanks for the answer.



Your solution might work.

I'm just not sure when this error is raised. If it happens when I call the function create_participant() than it's too late to detect it with the ErrorInfo API (that because the applications exits as soon as the function is called).


Thanks again,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now