mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix wake-on-lan failure on LAN after ARP cache expiration of target PC
This commit is contained in:
parent
6eed8408fc
commit
7a8166ec09
@ -22,8 +22,12 @@ public class WakeOnLanSender {
|
||||
boolean sentWolPacket = false;
|
||||
|
||||
try {
|
||||
// Try all resolved remote and local addresses
|
||||
for (String unresolvedAddress : new String[] {computer.localAddress, computer.remoteAddress}) {
|
||||
// Try all resolved remote and local addresses and IPv4 broadcast address.
|
||||
// The broadcast address is required to avoid stale ARP cache entries
|
||||
// making the sleeping machine unreachable.
|
||||
for (String unresolvedAddress : new String[] {
|
||||
computer.localAddress, computer.remoteAddress, "255.255.255.255"
|
||||
}) {
|
||||
try {
|
||||
for (InetAddress resolvedAddress : InetAddress.getAllByName(unresolvedAddress)) {
|
||||
// Try all the ports for each resolved address
|
||||
|
Loading…
x
Reference in New Issue
Block a user