mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 10:32:43 +00:00
Add support for IPv6-only hosts
This commit is contained in:
parent
27f0fd63b3
commit
a1c659b7b8
@ -3,6 +3,7 @@ package com.limelight.computers;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
import java.net.Inet4Address;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -300,16 +301,18 @@ public class ComputerManagerService extends Service {
|
|||||||
ComputerDetails details = new ComputerDetails();
|
ComputerDetails details = new ComputerDetails();
|
||||||
|
|
||||||
// Populate the computer template with mDNS info
|
// Populate the computer template with mDNS info
|
||||||
if (computer.getAddressV4() != null) {
|
if (computer.getLocalAddress() != null) {
|
||||||
details.localAddress = computer.getAddressV4().getHostAddress();
|
details.localAddress = computer.getLocalAddress().getHostAddress();
|
||||||
|
|
||||||
// Since we're on the same network, we can use STUN to find
|
// Since we're on the same network, we can use STUN to find
|
||||||
// our WAN address, which is also very likely the WAN address
|
// our WAN address, which is also very likely the WAN address
|
||||||
// of the PC. We can use this later to connect remotely.
|
// of the PC. We can use this later to connect remotely.
|
||||||
details.remoteAddress = NvConnection.findExternalAddressForMdns("stun.moonlight-stream.org", 3478);
|
if (computer.getLocalAddress() instanceof Inet4Address) {
|
||||||
|
details.remoteAddress = NvConnection.findExternalAddressForMdns("stun.moonlight-stream.org", 3478);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (computer.getAddressV6() != null) {
|
if (computer.getIpv6Address() != null) {
|
||||||
details.ipv6Address = computer.getAddressV6().getHostAddress();
|
details.ipv6Address = computer.getIpv6Address().getHostAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kick off a serverinfo poll on this machine
|
// Kick off a serverinfo poll on this machine
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 5872c0bf3de27e8346258119abf341d5cd64d1d8
|
Subproject commit a279f26b3fa8bb98e14839e55f507d798dfbc530
|
Loading…
x
Reference in New Issue
Block a user