mirror of
https://github.com/brunodev85/winlator.git
synced 2024-11-26 22:50:32 +00:00
Add fallback for local socket address
Same problem and same solution as https://github.com/brunodev85/winlator/pull/48 To be more clear: getLocalHost might fail (as it does on my device, where I have a nethunter chroot which sets kali as hostname and getLocalHost can't resolve it) getLoopbackAddress would be a more elegant solution if it would get the loopback ipv4, but it might return an ipv6 (again, in my case it does) which doesn't actually connect to the server
This commit is contained in:
parent
e6dd7a5976
commit
6f552dd66a
@ -254,7 +254,11 @@ public class WinHandler {
|
||||
try {
|
||||
localhost = InetAddress.getLocalHost();
|
||||
}
|
||||
catch (UnknownHostException e) {}
|
||||
catch (UnknownHostException e) {
|
||||
try {
|
||||
localhost = InetAddress.getByName("127.0.0.1");
|
||||
} catch (UnknownHostException ex) {}
|
||||
}
|
||||
|
||||
running = true;
|
||||
startSendThread();
|
||||
|
Loading…
Reference in New Issue
Block a user