mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +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;
|
boolean sentWolPacket = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Try all resolved remote and local addresses
|
// Try all resolved remote and local addresses and IPv4 broadcast address.
|
||||||
for (String unresolvedAddress : new String[] {computer.localAddress, computer.remoteAddress}) {
|
// 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 {
|
try {
|
||||||
for (InetAddress resolvedAddress : InetAddress.getAllByName(unresolvedAddress)) {
|
for (InetAddress resolvedAddress : InetAddress.getAllByName(unresolvedAddress)) {
|
||||||
// Try all the ports for each resolved address
|
// Try all the ports for each resolved address
|
||||||
|
Loading…
x
Reference in New Issue
Block a user