-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use default build-in transport in reliable mode, the last one packet or last several packets can not be received by subscriber #5280
Comments
Hi @yuzu-ogura, |
of course @JesusPoderoso .
datareaderqos is like below:
other qos all apply the default qos
idl like below:
|
@yuzu-ogura are the endpoints running in the same process? |
Using the wait-for-acknowledgments method forces the publisher to wait until the sample has been acknowledged. You may consider using the method on the last sample to force that @yuzu-ogura. You may also consider checking the |
yes. pub and sub are run separately on different host. And pub will only exit when all the data had been sent . The sub will always sleep in main thread to avoid exiting. |
so, if |
The |
In such a reliable case scenario, you should wait until all data has been received too. |
This approach will block until sub really receive data or timeout. However, it may reduce the sending rate ? |
@JesusPoderoso Sorry, I realized it was my fault .Thanks for your enthusiastically reply . Just now I found another scene that call |
Yes
No, because you only wait the ack of the sent samples after all samples have been sent. while(index < 999) {
HelloWorld hello;
hello.index(++index);
if (!datawriter->write(&hello)){
std::cout << "Could not send message with index " << index << std::endl;
}
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
datawriter->wait_for_acknowledgments(eprosima::fastrtps::Duration_t(1, 0)); // wait 1 sec |
I would recommend you @yuzu-ogura to follow the best-practices structure of the refactored examples in Fast DDS v3. In particular, the mechanism to determine that endpoints have already matched before start sending messages. |
OK, Thanks for your enthusiastically reply. |
Is there an already existing issue for this?
Expected behavior
in reliable mode, all packet maybe received by subscriber
Current behavior
the last one packet or last several packets can not be received by subscriber
Steps to reproduce
// high frequency send data
while(i < 1000) {
datawriter->write(userdata);
}
Fast DDS version/commit
v2.6.9
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
Default configuration, UDPv4 & SHM
Additional context
No response
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: