Repository navigation
multicast_dns 0.2.0 not detecting mDNS packets #79772
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 6, 2021 Hi @biagiopietro
I am not familiar withgobut I just installedgoand tried your command, i get the following errortahatesser@Tahas-MBP AndroidStudioProjects % go get github.com/hashicorp/mdns && go run main.go stat main.go: no such file or directory tahatesser@Tahas-MBP AndroidStudioProjects % ls tahatesser@Tahas-MBP AndroidStudioProjects %version
tahatesser@Tahas-MBP AndroidStudioProjects % go version go version go1.16.3 darwin/amd64 tahatesser@Tahas-MBP AndroidStudioProjects %Can you please update the reproducible steps
Thank you- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 6, 2021 Hello @TahaTesser,
You need to put theGocode in a file calledmain.goand rungo run main.go, please make sure you're running that command in the same folder of yourmain.go. To make sure that the server is running, you can runcurl -X GET 'http://localhost:8081/'and then you should receive anok(see screenshot)

Please let me know how can I help (reproducible steps updated)- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 6, 2021 @biagiopietro
I did the same steps, created a folder andmain.gofile and copied theGocode and ran the command, I gettahatesser@Tahas-MBP test_go % ls main.go tahatesser@Tahas-MBP test_go % go get -u github.com/hashicorp/mdns && go run main.go main.go:5:2: no required module provides package github.com/hashicorp/mdns: go.mod file not found in current directory or any parent directory; see 'go help modules' tahatesser@Tahas-MBP test_go %Edit:
Tried on a different computer, same error- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 7, 2021 @TahaTesser really weird behavior. 😞 I've tried also on
OSXandUbuntumachines without any issue.
Could you please rungo mod init mainin the same location of yourmain.go.
It will generate ago.modfile and inside you should put the following linerequire github.com/hashicorp/mdns v1.0.3(aftermodule main).
Once you are done please save the file and run againgo run main.go(see screenshot for more details)

- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 7, 2021 I saw that you are using
Go version go1.16.3so I upgraded also to that version and I tried the steps described before and they worked for meHi @biagiopietro
Thanks for the details,go mod init maindid the trick and main.go is running andcurl -X GET 'http://localhost:8081/'is returningoklogs
Launching lib/main.dart on RMX2001 in debug mode... ✓ Built build/app/outputs/flutter-apk/app-debug.apk. Connecting to VM Service at ws://127.0.0.1:45587/dDUB8u2-dhU=/ws I/flutter (15328): Hostname 0.0.0.0 I/flutter (15328): Port 5353 I/flutter (15328): Hostname InternetAddress('127.0.0.1', IPv4) I/flutter (15328): Port 5353 I/flutter (15328): Hostname InternetAddress('192.168.0.159', IPv4) I/flutter (15328): Port 5353 D/ColorViewRootUtil(15328): nav gesture mode swipeFromBottom ignore false downY 1242 mScreenHeight 2400 mScreenWidth 1080 mStatusBarHeight 54 globalScale 1.125 nav mode 3 event MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=432.0, y[0]=1242.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=291572, downTime=291572, deviceId=3, source=0x1002, displayId=0 } rotation 0 I/flutter (15328): Done. I/SurfaceView(15328): 229261539 visibleChanged:true -> SurfaceHolder.Callback.surfaceDestroyed D/Surface (15328): Surface::disconnect(this=0x70d00e6000,api=1) D/ViewRootImpl(15328): setSurfaceViewCreated, created:false D/Surface (15328): Surface::disconnect(this=0x70d00e6000,api=-1) D/SurfaceView(15328): updateScreenMode w:0 h:0 ViewRoot w:1080 h:2400 D/SurfaceView(15328): try to resquest 90Hz D/ViewRootImpl(15328): set screen refresh mode 0 due to SurfaceView-229261539 I/Choreographer(15328): Skipped 5 frames! The application may be doing too much work on its main thread. I/GED (15328): ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 27, oppidx_max 27, oppidx_min 0 D/Surface (15328): Surface::disconnect(this=0x70d00e4000,api=1) V/PhoneWindow(15328): DecorView setVisiblity: visibility = 4, Parent = android.view.ViewRootImpl@89f9b74, this = DecorView@9560761[MainActivity]
dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 multicast_dns: ^0.2.2
flutter doctor -v
taha@taha-Lenovo-ideapad-510S-14IKB:~/AndroidStudioProjects$ fsd [✓] Flutter (Channel stable, 2.0.4, on Linux, locale en_IN) • Flutter version 2.0.4 at /home/taha/Code/flutter_stable • Framework revision b1395592de (6 days ago), 2021-04-01 14:25:01 -0700 • Engine revision 2dce47073a • Dart version 2.12.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /home/taha/Code/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /home/taha/Code/SDK • Java binary at: /home/taha/Code/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Chrome - develop for the web • Chrome at google-chrome [✓] Linux toolchain - develop for Linux desktop • clang version 10.0.0-4ubuntu1 • cmake version 3.16.3 • ninja version 1.10.0 • pkg-config version 0.29.1 [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [✓] Connected device (3 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • Linux (desktop) • linux • linux-x64 • Linux • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90 ! Doctor found issues in 1 category. taha@taha-Lenovo-ideapad-510S-14IKB:~/AndroidStudioProjects$
Thanks for filing the issue
- addedfound in release: 2.0Found to occur in 2.0Found to occur in 2.0has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 8, 2021 28 remaining items
- addedteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
on Jul 8, 2023 This is still not working properly as of today. A mDNS resolver on my device shows me what I am looking for, but multicast_dns usually does not resolve anything. Sometimes it does....
Hello everyone,
My apologies for the long absence on this.
I will try to follow up again, from what I checked looks like that there are some edge cases on network level that are not handled properly.
I need to dust off again wireshark and have a deep look.Reacted by MarcelHi @MarcelKr ,@mbalmer, @exaby73
It took a while to investigate a possible solution, I put findings and 2 proposals in the followingPR(I just applied one)Please I'm not an expert and I would like to have also your eyes on it.
(Having a confirmation that it fixes also in your case is really appreciated)
- linked a pull request that will close this issue[multicast_dns] Optimized Socket Binding: Always bind to 0.0.0.0 for simplicity and efficiency - #79772 #6700
on May 9, 2024 Hey @biagiopietro. Thanks for taking the time in attempting to fix this, that's really cool! However I'm absolutely not confident in making any judgement on the PR since I'm neither an expert in dart (which would probably not be the big issue here) nor in the details one needs to know about networking to add profound statements unfortunately :/
Reacted by MrJack- added a commit that references this issue
on Jun 24, 2024 - added a commit that references this issue
on Jun 25, 2024 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jul 8, 2024



I'm trying to do a lookup of a specific service using
mDNSbut the client in Flutter returns nothing albeit the host (Android Device) received the correct packet frommDNS server(see Wireshark section).Steps to Reproduce
mDNS server(you can use the following code inGo. So you need to put theGocode in a file calledmain.goand rungo get -u github.com/hashicorp/mdns && go run main.go, please make sure you're running that command in the same folder of yourmain.go. To make sure that the server is running, you can runcurl -X GET 'http://localhost:8081/'and then you should receive anok(see screenshot)mDNS serveris working you can run (OSX):dns-sd -B _test._tcp(Linux:sudo apt-get install avahi-deamonavahi-utils && avahi-browse -rt _test._tcp)flutter run -d <android-device>.Expected results:
Something like
Dart observatory instance found at...Actual results:
Logs
flutter doctor -vflutter attach --verbose[ +148 ms] executing: [/home/puma/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +72 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] b1395592de68cc8ac4522094ae59956dd21a91db [ +1 ms] executing: [/home/puma/snap/flutter/common/flutter/] git tag --points-at b1395592de68cc8ac4522094ae59956dd21a91db [ +24 ms] Exit code 0 from: git tag --points-at b1395592de68cc8ac4522094ae59956dd21a91db [ ] 2.0.4 [ +79 ms] executing: [/home/puma/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +8 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/stable [ ] executing: [/home/puma/snap/flutter/common/flutter/] git ls-remote --get-url origin [ +9 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ +114 ms] executing: [/home/puma/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD [ +10 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] stable [ +151 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +3 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +12 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +154 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ +123 ms] executing: /mnt/hd/Android/android-sdk-linux/platform-tools/adb devices -l [ +68 ms] List of devices attached testAndroid device usb:2-1.1 product:ANE-LX1 model:ANE_LX1 device:HWANE transport_id:1 [ +102 ms] /mnt/hd/Android/android-sdk-linux/platform-tools/adb -s testAndroid shell getprop [ +163 ms] Waiting for a connection from Flutter on ANE LX1... [ +134 ms] Observatory URL on device: http://127.0.0.1:36421/LB5gpdiwoUU=/ [ +2 ms] executing: /mnt/hd/Android/android-sdk-linux/platform-tools/adb -s testAndroid forward tcp:0 tcp:36421 [ +15 ms] 45003 [ +1 ms] Forwarded host port 45003 to device port 36421 for Observatory [ +9 ms] Connecting to service protocol: http://127.0.0.1:45003/LB5gpdiwoUU=/ [ +186 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:45003/LB5gpdiwoUU=/. [ +404 ms] Warning: Failed to start DDS: JSON-RPC error 100: Feature is disabled data: {details: A DDS instance is already connected at http://127.0.0.1:32821/rrJgFvQe3xQ=/., request: {jsonrpc: 2.0, method: _yieldControlToDDS, id: 8, params: {uri: http://127.0.0.1:37321/2bciKM125Ng=/}}} [ +55 ms] Successfully connected to service protocol: http://127.0.0.1:45003/LB5gpdiwoUU=/ [ +2 ms] executing: /mnt/hd/Android/android-sdk-linux/platform-tools/adb -s testAndroid shell -x logcat -v time -t 1 [ +84 ms] --------- beginning of main 04-05 14:15:50.212 I/TrafficMonitor( 1273): gettimer:interval=2000 [ +955 ms] DevFS: Creating new filesystem on the device (null) [ +18 ms] DevFS: Creating failed. Destroying and trying again [ +1 ms] DevFS: Deleting filesystem on the device (null) [ +34 ms] DevFS: Deleted filesystem on the device (null) [ +15 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.example.test_mdns_client/code_cache/test_mdns_clientJAQOEZ/test_mdns_client/) [ +10 ms] Updating assets [ +299 ms] Syncing files to device ANE LX1... [ +4 ms] <- reset [ ] Compiling dart to kernel with 0 updated files [ +17 ms] /home/puma/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /home/puma/snap/flutter/common/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root /home/puma/snap/flutter/common/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata --output-dill /tmp/flutter_tools.FDFYPD/flutter_tool.JBRCDK/app.dill --packages /home/puma/StudioProjects/test_mdns_client/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build/cache.dill.track.dill [ +12 ms] <- compile package:test_mdns_client/main.dartpubspec.yamlWireshark
Where:
192.168.2.1istestAndroiddevice;192.168.2.4is the device where mDNS server is running on.Thanks in advance for your help!!!