Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressing issues #63
The section you're referring to for handling UDP in your
Browser
class is located in the constructor, specifically where theprotocol
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 toudp
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 inopts
. This could override your intention to useudp
.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!