Comments (2)
Hi @lin0303-siyuan,
tl;dr: eCAL always needs a little time to start up. By default, 1 seconds. If you sleep >1s before publishing your first message, you should receive it.
Long explanation
In eCAL, 2 different communications are always happening simultaneously.
- The data-communication is what you are actually seeing. This transports the payload, in your case the "Hello World" Strings.
- In the background, hidden from you, eCAL however has to send around some metadata. This metadata is for instance responsible for individual nodes finding each other.
In order to have a successful connection from a publisher to a subscriber, the following information have to be exchanged:
- The publisher must receive the information that a subscriber for its topic exists and where it lives (to determine the data transport layer like UDP for network or SHM for localhost). While the eCAL API already allows you to publish data without having a subscriber, the eCAL library will simply do nothing if there is no subscriber, in order to save system resources.
- The subscriber must receive information from the publisher about how the data will be transmitted. Again, it must know about the concrete layer (UDP, TCP, SHM), as well as the layer parameters (Port for TCP, SHM filename for SHM)
Only after these information have been exchanges successfully, the data communcation can start. The metadata is however only transmitted once every 1s. Therefore, if you call publisher.Send()
directly after you created the publisher, eCAL didn't have enough time for publisher <-> subscriber matching, yet.
You should easily be able to work around this, by adding a delay between the instantiation of your publisher and the first Send()
call. For instance, you can move the std::chrono::sleep_for
to the beginning of the while loop, so that eCAL has some time to establish all connections.
Kind Regards
Florian
from ecal.
Really appreciate your answer, it solved my problem. It's such a nice explanation.
from ecal.
Related Issues (20)
- eCAL does not build with Protobuf 3.26
- eCAL TCP Layer, attempt to resolve .local instead of just hostname [Link-local connection] HOT 1
- [core] Race condition in ecal_registration_provider.cpp
- Docs build broken with newest Sphinx release HOT 1
- Update Code Sign Action
- Recreating subscriber in the same process leads to no messages received HOT 2
- Build fails with spdlog 1.14.0: error: undefined symbol: spdlog::get(char const*) HOT 2
- eCAL Rec crash with eCAL 5.13.0 + 5.12.4
- UserWarning: MessageFactory class is deprecated HOT 1
- Support Capnproto Serialization in Python.
- Fix Warnings in documentation build.
- Filter function in eCAL Monitor broken on Ubuntu 20.04
- eCAL Rec GUI falsly reports "Not Started" for local recording
- [C#] Protobuf objects in callbacks might contain old values
- Frequency Calculation broken if non Subscriber present
- Ram usage is increasing continuously while running ecal python code HOT 3
- eCAL 6
- eCAL5 backporting
- [Build] npcap.com site down HOT 1
- CSubscriber create dead lock
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecal.