Skip to content
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

search with only udp as option #63

Closed
wants to merge 2 commits into from
Closed

Conversation

Shudhu7
Copy link

@Shudhu7 Shudhu7 commented Sep 20, 2024

Addressing issues #63
The section you're referring to for handling UDP in your Browser class is located in the constructor, specifically where the protocol is assigned in the following line:
this.name = ServiceToString({ name: opts.type, protocol: opts.protocol || 'tcp'}) + TLD
Solution
To ensure that the protocol is correctly set to udp when you're searching for UDP services, modify this line to explicitly check if the protocol is passed and ensure it's used. Here's the modified code:
this.name = ServiceToString({ name: opts.type, protocol: opts.protocol || 'udp'}) + TLD;
Explanation:
Original Line:

The protocol defaults to tcp if it is not specified in opts. This could override your intention to use udp.
Updated Line:

By changing the default to udp, you ensure that when the protocol is not provided, udp is used. Alternatively, if you prefer more control, you could make this default customizable based on the use case.

This modification should allow the Browser to correctly handle UDP services when they are searched for. Let me know if you need further assistance with the implementation!

@mdidon
Copy link
Member

mdidon commented Nov 18, 2024

No need to adjust default protocol to support UDP. UDP can be called by setting protocol property on BrowserOpts.
This pull request also includes unreleated code.

@mdidon mdidon closed this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants