commonMain.io.github.petretiandrea.socket.SocketInterface.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
import io.github.petretiandrea.socket.stream.InputStream
import io.github.petretiandrea.socket.stream.OutputStream
@ExperimentalUnsignedTypes
interface SocketInterface {
fun inputStream(): InputStream
fun outputStream(): OutputStream
fun isConnected(): Boolean
suspend fun close()
}
expect fun createSocket(hostname: String, port: Int): SocketInterface