Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Fixed a byte order bug in BrowseService.cs. #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjvanrossum
Copy link

Changed BrowseService.cs due to recent changes in byte order handling.
Port numbers returned by resolved services should now be correct.

Changed BrowseService.cs due to recent changes in byte order handling.
Port numbers returned by resolved services should now be correct.
@sjvanrossum
Copy link
Author

This Gist demonstrates the correctness of the commit in this pull request, when you run it on the current master branch of mono/Mono.ZeroConf.
Which should output something like this on a succesful runthrough:

Service registered at port 80.
Resolved port as 20480, without NetworkToHostOrder.
Resolved port as 80, with NetworkToHostOrder.

Also, here's an example from a MZClient query to my Bonjour printer advertising a _http._tcp service on port 80.

mono/Mono.Zeroconf output:

Hit ^C when you're bored waiting for responses.

*** Found name = 'Photosmart 3300 series [401F97]', type = '_http._tcp.', domain = 'local.'
*** Resolved name = 'Photosmart\0323300\032series\032[401F97]._http._tcp.local.', host ip = '10.0.0.3', hostname = , port = '20480', interface = '10', address type = 'Any', TXT Record = [ = '']

JvetS/Mono.Zeroconf output:

Hit ^C when you're bored waiting for responses.

*** Found name = 'Photosmart 3300 series [401F97]', type = '_http._tcp.', domain = 'local.'
*** Resolved name = 'Photosmart\0323300\032series\032[401F97]._http._tcp.local.', host ip = '10.0.0.3', hostname = , port = '80', interface = '10', address type = 'Any', TXT Record = [ = '']

@jasoncouture
Copy link

This issue still exists, I cloned master after numerous issues with the nuget package. I have to change the byte order, I applied the fixes in this pull request and the issue was resolved.

@yanhkim
Copy link
Contributor

yanhkim commented Sep 11, 2013

👍

@piedar
Copy link

piedar commented Mar 2, 2015

Nuget package is still broken, 3.5 years after this one-line patch was suggested.

@sjvanrossum
Copy link
Author

I've sent out an email to Aaron. I was surprised to see this PR still hasn't been closed after 4 years.

@Lakritzator
Copy link

I also wanted to use this library, but with all the PRs still open it seems a bit old...

cerebrate added a commit to arkane-systems/Arkane.Zeroconf that referenced this pull request Apr 30, 2017
@Sobia01
Copy link

Sobia01 commented Jun 15, 2017

Cannot use port valuer overflow Int16. Any solution?

@piedar
Copy link

piedar commented Jun 15, 2017

For those seeking alternatives: I've had success with Tmds.MDns, which is standalone (no Bonjour or Avahi) and actually works.

@Sobia01
Copy link

Sobia01 commented Jun 26, 2017 via email

@Sobia01

This comment has been minimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants