added comment
This commit is contained in:
parent
66cfe2a6ad
commit
54a0e140f6
1 changed files with 3 additions and 0 deletions
|
@ -47,6 +47,9 @@ class ServerInfoProviderImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// perform fake request to 1.1.1.1:80 just to get the localAddress
|
||||||
|
// with use of the default routing.
|
||||||
|
// if it fails, we use the localAddress() which can be wrong
|
||||||
private fun guessLocalAddress() = try {
|
private fun guessLocalAddress() = try {
|
||||||
DatagramSocket().use { s ->
|
DatagramSocket().use { s ->
|
||||||
s.connect(InetAddress.getByAddress(byteArrayOf(1, 1, 1, 1)), 80)
|
s.connect(InetAddress.getByAddress(byteArrayOf(1, 1, 1, 1)), 80)
|
||||||
|
|
Loading…
Reference in a new issue