commonMain.com.ditchoom.socket.SocketController.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of socket-js Show documentation
Show all versions of socket-js Show documentation
Simple multiplatform kotlin coroutines based socket.
@file:Suppress("EXPERIMENTAL_API_USAGE")
package com.ditchoom.socket
import com.ditchoom.buffer.PlatformBuffer
import com.ditchoom.buffer.ReadBuffer
import com.ditchoom.buffer.SuspendCloseable
import com.ditchoom.data.Reader
import com.ditchoom.data.Writer
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
import kotlin.time.ExperimentalTime
@ExperimentalTime
interface SocketController : Reader, Writer, SuspendCloseable {
override fun isOpen(): Boolean
/**
* Suspends the caller until the socket connection has fully closed.
*/
suspend fun awaitClose()
}