| 401 | {} |
| 402 | |
| 403 | DDS::ReturnCode_t |
| 404 | Sedp::init(const GUID_t& guid, |
| 405 | const RtpsDiscovery& disco, |
| 406 | DDS::DomainId_t domainId, |
| 407 | DDS::UInt16 ipv4_participant_port_id, |
| 408 | #ifdef ACE_HAS_IPV6 |
| 409 | DDS::UInt16 ipv6_participant_port_id, |
| 410 | #endif |
| 411 | XTypes::TypeLookupService_rch tls) |
| 412 | { |
| 413 | type_lookup_service_ = tls; |
| 414 | |
| 415 | const String uniqueId = DCPS::GuidConverter(guid).uniqueParticipantId() + '_' + DCPS::to_dds_string(domainId); |
| 416 | |
| 417 | // configure one transport |
| 418 | transport_inst_ = TheTransportRegistry->create_inst( |
| 419 | DCPS::TransportRegistry::DEFAULT_INST_PREFIX + String("SEDPTransportInst_") + uniqueId, |
| 420 | "rtps_udp"); |
| 421 | config_store_->add_section("TRANSPORT", transport_inst_->name()); |
| 422 | |
| 423 | // Be careful to not call any function that causes the transport be |
| 424 | // to created before the configuration is complete. |
| 425 | |
| 426 | config_store_->set_uint32(transport_inst_->config_key("MAX_MESSAGE_SIZE").c_str(), |
| 427 | static_cast<DDS::UInt32>(disco.config()->sedp_max_message_size())); |
| 428 | config_store_->set(transport_inst_->config_key("HEARTBEAT_PERIOD").c_str(), |
| 429 | disco.config()->sedp_heartbeat_period(), ConfigStoreImpl::Format_IntegerMilliseconds); |
| 430 | config_store_->set(transport_inst_->config_key("NAK_RESPONSE_DELAY").c_str(), |
| 431 | disco.config()->sedp_nak_response_delay(), ConfigStoreImpl::Format_IntegerMilliseconds); |
| 432 | config_store_->set_boolean(transport_inst_->config_key("RESPONSIVE_MODE").c_str(), |
| 433 | disco.config()->sedp_responsive_mode()); |
| 434 | config_store_->set(transport_inst_->config_key("SEND_DELAY").c_str(), |
| 435 | disco.config()->sedp_send_delay(), ConfigStoreImpl::Format_IntegerMilliseconds); |
| 436 | config_store_->set_int32(transport_inst_->config_key("SEND_BUFFER_SIZE").c_str(), |
| 437 | disco.config()->send_buffer_size()); |
| 438 | config_store_->set_int32(transport_inst_->config_key("RCV_BUFFER_SIZE").c_str(), |
| 439 | disco.config()->recv_buffer_size()); |
| 440 | transport_inst_->receive_preallocated_message_blocks(disco.config()->sedp_receive_preallocated_message_blocks()); |
| 441 | transport_inst_->receive_preallocated_data_blocks(disco.config()->sedp_receive_preallocated_data_blocks()); |
| 442 | |
| 443 | set_port_mode(transport_inst_->config_key("PORT_MODE").c_str(), disco.config()->sedp_port_mode()); |
| 444 | config_store_->set_int32(transport_inst_->config_key("PB").c_str(), disco.config()->pb()); |
| 445 | config_store_->set_int32(transport_inst_->config_key("DG").c_str(), disco.config()->dg()); |
| 446 | config_store_->set_int32(transport_inst_->config_key("PG").c_str(), disco.config()->pg()); |
| 447 | config_store_->set_int32(transport_inst_->config_key("D2").c_str(), disco.config()->dx()); |
| 448 | config_store_->set_int32(transport_inst_->config_key("D3").c_str(), disco.config()->dy()); |
| 449 | |
| 450 | const bool sedp_multicast = disco.sedp_multicast(); |
| 451 | config_store_->set_boolean(transport_inst_->config_key("USE_MULTICAST").c_str(), sedp_multicast); |
| 452 | if (sedp_multicast) { |
| 453 | config_store_->set(transport_inst_->config_key("MULTICAST_GROUP_ADDRESS").c_str(), |
| 454 | disco.config()->sedp_multicast_address(domainId), |
| 455 | ConfigStoreImpl::Format_Optional_Port, |
| 456 | ConfigStoreImpl::Kind_IPV4); |
| 457 | |
| 458 | config_store_->set_uint32(transport_inst_->config_key("TTL").c_str(), disco.ttl()); |
| 459 | config_store_->set(transport_inst_->config_key("MULTICAST_INTERFACE").c_str(), disco.multicast_interface()); |
| 460 | } |
no test coverage detected