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 from mobile hotspot #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/src/discovery.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
part of upnp;

final InternetAddress _v4_Multicast = new InternetAddress("239.255.255.250");
final InternetAddress _v4_Multicast_1 = new InternetAddress("255.255.255.255");
final InternetAddress _v6_Multicast = new InternetAddress("FF05::C");

class DeviceDiscoverer {
Expand Down Expand Up @@ -81,6 +82,11 @@ class DeviceDiscoverer {
socket.joinMulticast(_v4_Multicast);
} on OSError {
}

try {
socket.joinMulticast(_v4_Multicast_1);
} on OSError {
}

try {
socket.joinMulticast(_v6_Multicast);
Expand All @@ -92,6 +98,11 @@ class DeviceDiscoverer {
socket.joinMulticast(_v4_Multicast, interface);
} on OSError {
}

try {
socket.joinMulticast(_v4_Multicast_1, interface);
} on OSError {
}

try {
socket.joinMulticast(_v6_Multicast, interface);
Expand Down Expand Up @@ -141,6 +152,11 @@ class DeviceDiscoverer {
socket.send(data, _v4_Multicast, 1900);
} on SocketException {
}

try {
socket.send(data, _v4_Multicast_1, 1900);
} on SocketException {
}
}

if (socket.address.type == _v6_Multicast.type) {
Expand Down