
jvmMain.com.ditchoom.socket.nio.util.StringExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of socket-jvm Show documentation
Show all versions of socket-jvm Show documentation
Simple multiplatform kotlin coroutines based socket.
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