Replies: 1 comment
-
Static EDP suppresses the Endpoint Discovery Phase (EDP). All information sent in this phase is substituted by an XML If a user sets in the static EDP xml that the reader is using an unicast locator ( fast::SubscriberAttributes sattribs;
sattribs.topic.topicKind = rtps::NO_KEY;
sattribs.topic.topicDataType = "MyData";
sattribs.topic.topicName = "myTopic";
sattribs.qos.m_reliability.kind = fast::RELIABLE_RELIABILITY_QOS;
sattribs.setUserDefinedID(3);
sattribs.setEntityID(4);
LocatorList_t unicastLocators;
Locator_t locator;
locator.kind = LOCATOR_KIND_UDPv4;
locator.port = static_cast<uint16_t>(7412);
IPLocator::setIPv4(locator, 192, 168, 40, 100);
unicastLocators.push_back(locator);
sattribs.unicastLocatorList = unicastLocators;
_subscriber = fast::Domain::createSubscriber(_participant, sattribs,
(fast::SubscriberListener*) &_listener); Did you configure the You're using the old API (FastRTPS API) that is being deprecated, and maybe is not fully documented. I advice you to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have two participants coded exactly like the StaticHelloWorld example. One is a publisher, the second is a subscriber. All works fine if there are no unicastLocator's and multicastLocator's within the static EDP XML configs below, the publisher and subscriber will communicate. If the locators (unicast is my local host ip) are added, the subscriber will call onSubscriptionMatched(), but onNewDataMessage() is never called. Removing the locators allows them to talk again w/o any issues.
With locators added to edp xml configs, this gets called but onNewDataMessage() does not.
The setup of the participants look like the following with matching changes in agreement to the edp xml file set in static_edp_xml_config.
One more thing to add, when I fire off the subscriber, it immediately publishes a message, then quits. If I don't add the following line before my call to publish(), it's as if associations don't have time to be established and the message won't be received.
std::this_thread::sleep_for(std::chrono::milliseconds(250));
Also, I don't understand why there's no mention of classes like
eprosima::fastrtps::PublisherListener
in the C++ API refs or elsewhere, yet there is
eprosima::fastdds::dds::PublisherListener
The static discovery docs make things muddy at best. I was unable to get them to work by loading profiles, and therefore went to hard-coding the participant and attributes and passing in the destination xml to get things to work, to no avail.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions