int domain_id = 10;
DomainParticipantQos participant_qos = new DomainParticipantQos();
factory.get_default_participant_qos(participant_qos);
final String[] NDDS_DISCOVERY_INITIAL_PEERS = {
"1@udpv4://10.10.1.192",
"1@udpv4://10.10.1.190",
"1@udpv4://10.10.1.152"
};
participant_qos.discovery.initial_peers.
ensureCapacity(NDDS_DISCOVERY_INITIAL_PEERS.length);
for (int i = 0; i < NDDS_DISCOVERY_INITIAL_PEERS.length; ++i) {
participant_qos.discovery.initial_peers.add(
NDDS_DISCOVERY_INITIAL_PEERS[i]);
}
DomainParticipantListener participant_listener = null;
DomainParticipant participant = null;
try {
participant = factory.create_participant(
domain_id, participant_qos,
participant_listener, StatusKind.STATUS_MASK_NONE);
} catch (RETCODE_ERROR err) {
}