
commonJvmMain.com.ditchoom.socket.nio.util.StringExtensions.kt Maven / Gradle / Ivy
package com.ditchoom.socket.nio.util
import java.net.InetAddress
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
suspend fun String?.asInetAddress() =
suspendCoroutine {
try {
it.resume(InetAddress.getByName(this))
} catch (e: Throwable) {
it.resumeWithException(e)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy