Skip to content

Commit

Permalink
Format NetworkServiceDiscovery
Browse files Browse the repository at this point in the history
  • Loading branch information
InvictusRMC committed Feb 19, 2024
1 parent 1cb0530 commit 60a9d95
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ class NetworkServiceDiscovery(

val peer = overlay.myPeer

val hostAddress = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
serviceInfo.hostAddresses.first().hostAddress!!
} else {
@Suppress("DEPRECATION") // Deprecated in API 34. So false positive.
serviceInfo.host.hostAddress!!
}
val hostAddress =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
serviceInfo.hostAddresses.first().hostAddress!!
} else {
@Suppress("DEPRECATION") // Deprecated in API 34. So false positive.
serviceInfo.host.hostAddress!!
}
val address = IPv4Address(hostAddress, serviceInfo.port)


if (overlay.myEstimatedLan != address) {
logger.debug { "Discovered address: $address" }
overlay.network.discoverAddress(peer, address, overlay.serviceId)
Expand Down

0 comments on commit 60a9d95

Please sign in to comment.