eclipse-ecal / ecal

📦 eCAL - enhanced Communication Abstraction Layer. A high performance publish-subscribe, client-server cross-plattform middleware.
https://ecal.io
Apache License 2.0
845 stars 177 forks source link

eCAL TCP Layer, attempt to resolve .local instead of just hostname [Link-local connection] #1531

Open FlorianReimold opened 7 months ago

FlorianReimold commented 7 months ago

I understand that in the current TCP mode, in order to use eCAL properly, we have to manually key in the hostname-IP mapping on the subscriber machine. This is pretty inconvenient for deployment to customers' machine.

I have tested on both Windows and Ubuntu Linux hosts. There is a good workaround potentially to make the TCP mode work without config.

The trick is that, althought hostnames are not resolved direclty, espically when there is not present of a router (e.g. direct ethernet cable connect of the host and edge machine), by adding the ".local" domain, the mDNS mechanism kicks and systems are able to resolve the hostname.

My suggestion is then:

  1. Make changes to the TCP pubsub behaviour, or at least make as a config setting, to fallback to .local domain, if the direct hostname could not be resolved
  2. This is actually the behaviour of "ping" command in Windows. Which is pretty neat.

Originally posted by @chengguizi in https://github.com/eclipse-ecal/ecal/discussions/1521

Roadmap

FlorianReimold commented 6 months ago

I started taking a look at this and implemented a first draft for eCAL Services. I didn't want to implicitely append '.local' from within the service lib, so I created an API that would not only get 1 possible endpoint but a list of them. If the first one wouldn't respond, the next one would be tried.

Unfortunately I cannot really test this at the moment due to technical reasons.

The current status can be compiled as follows:

git clone https://github.com/eclipse-ecal/ecal.git
cd ecal
git checkout feature/service_backup_domain 

git submodule init
git submodule update

cd ecal/service
mkdir build
cd build

cmake .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../../cmake/submodule_dependencies.cmake -DECAL_CORE_BUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Debug

cmake -build . --config=Debug
chengguizi commented 5 days ago

@FlorianReimold Pretty much still look forward to having this mDNS feature. Just to check if it is still being considered for a near future release? Thanks!

FlorianReimold commented 2 days ago

We still need at least support for tcp_pubsub (i.e. the TCP layer of eCAL). I didn't have time to work on it, but it is still on the list. The eCAL Services are already working.