All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.com.ditchoom.socket.nio.util.StringExtensions.kt Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
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