commonMain.io.github.petretiandrea.socket.stream.StreamIO.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
A naive socket multiplatform implementation
package io.github.petretiandrea.socket.stream
import io.github.petretiandrea.socket.buffer.MultiplatformBuffer
import kotlin.time.Duration
interface InputStream {
suspend fun read(buffer: MultiplatformBuffer): Int
suspend fun read(buffer: MultiplatformBuffer, timeout: Duration): Int
suspend fun close()
}
interface OutputStream {
suspend fun send(buffer: MultiplatformBuffer): Boolean
suspend fun close()
}