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

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