All Projects → cy6erGn0m → kotlinx-sockets

cy6erGn0m / kotlinx-sockets

Licence: other
Kotlinx coroutines sockets

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to kotlinx-sockets

Reader
一个自用的小说阅读器 kotlin 协程、rhino、Javascript
Stars: ✭ 20 (-62.96%)
Mutual labels:  coroutines
boost beast websocket echo
A collection of Demo applications to try to help you understand how Asio and Beast work
Stars: ✭ 12 (-77.78%)
Mutual labels:  coroutines
moko-errors
Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development.
Stars: ✭ 45 (-16.67%)
Mutual labels:  coroutines
asynchronous
A D port of Python's asyncio library
Stars: ✭ 35 (-35.19%)
Mutual labels:  coroutines
multithread-mpp
This is the best architecture of Kotlin Multiplatform Project I think! This project works on background thread using kotlinx.Coroutines.
Stars: ✭ 16 (-70.37%)
Mutual labels:  coroutines
Compose-BreakingBad
🧪 ☠︎ Jetpack Compose - Breaking Bad ☢︎
Stars: ✭ 26 (-51.85%)
Mutual labels:  coroutines
UnityHFSM
A simple yet powerful class based hierarchical finite state machine for Unity3D
Stars: ✭ 243 (+350%)
Mutual labels:  coroutines
koru
Simple coroutine wrappers for Kotlin Native. Generated from annotations. Compatible with RxSwift, Combine etc.
Stars: ✭ 141 (+161.11%)
Mutual labels:  coroutines
korte
Kotlin cORoutines Template Engine for Multiplatform Kotlin
Stars: ✭ 69 (+27.78%)
Mutual labels:  coroutines
Paging-3-Sample
This app is created as a sample app which loads movies from Tmdb api and uses Paging 3 library to show it in a Recycler view.
Stars: ✭ 96 (+77.78%)
Mutual labels:  coroutines
Lastik
Kotlin Multiplatform + Jetpack Compose pet project, based on www.last.fm/api (in development)
Stars: ✭ 37 (-31.48%)
Mutual labels:  coroutines
RxCoroutineSchedulers
Kotlin Coroutines as RxJava Schedulers 😈
Stars: ✭ 31 (-42.59%)
Mutual labels:  coroutines
NYTimesMostPopularArticles
A simple app to hit the NY Times Most Popular Articles API and show a list of articles, that shows details when items on the list are tapped (a typical master/detail app), also user able to browse/ add articles to favorite list that implements MVVM architecture using Dagger2, Retrofit, Coroutines, LiveData, RoomDatabase, Database Debugging, Data…
Stars: ✭ 38 (-29.63%)
Mutual labels:  coroutines
DirectCurrencyConverter
Currency Converter App for Android showing usage of Flow, Live Data, Coroutines, Hilt - (Clean Architecture)
Stars: ✭ 40 (-25.93%)
Mutual labels:  coroutines
Retrofit2-Flow-Call-Adapter
A Retrofit 2 adapter for Kotlin Flows.
Stars: ✭ 41 (-24.07%)
Mutual labels:  coroutines
BlueFlow
Android Bluetooth classic API wrapped in Coroutines Flow.
Stars: ✭ 64 (+18.52%)
Mutual labels:  coroutines
netty-learning
bio, nio到 netty各种使用案例, 包含基础使用案例,各api使用方法,零拷贝,websocket,群聊,私聊,编码,解码,自定义协议,protobuf等使用案例,rpc服务器,客户端等等学习
Stars: ✭ 49 (-9.26%)
Mutual labels:  nio
JustJava-Android
JustJava is a mock food ordering and delivery application for a coffee shop.
Stars: ✭ 59 (+9.26%)
Mutual labels:  coroutines
yuzhouwan
Code Library for My Blog
Stars: ✭ 39 (-27.78%)
Mutual labels:  nio
GitKtDroid
A sample Android application📱 built with Kotlin for #30DaysOfKotlin
Stars: ✭ 53 (-1.85%)
Mutual labels:  coroutines

kotlinx sockets (🥚🥚🥚 incubating) status Download version

Kotlinx.sockets is a library to bring rich coroutines experience to NIO sockets, eliminate terrible callbacks and selector loops and related difficult code.

With the library and kotlin coroutines you can simply write async NIO code in usual synchronous style.

Consider example (full source)

fun main(args: Array<String>) {
    runBlocking { // start coroutines
        aSocket().tcp().connect(InetSocketAddress(InetAddress.getByName("google.com"), 80)).use { socket ->
            println("Connected") // now we are connected

            // chain of async write
            socket.send("GET / HTTP/1.1\r\n")
            socket.send("Host: google.com\r\n")
            socket.send("Accept: text/html\r\n")
            socket.send("Connection: close\r\n")
            socket.send("\r\n")

            // loop to read bytes and write to the console
            val bb = ByteBuffer.allocate(8192)
            while (true) {
                bb.clear()
                if (socket.read(bb) == -1) break // async read

                bb.flip()
                System.out.write(bb)
                System.out.flush()
            }

            println()
        }
    }
}

Getting started

Maven

<dependencies>
    <dependency>
        <groupId>org.jetbrains.kotlinx</groupId>
        <artifactId>kotlin-sockets</artifactId>
        <version>0.0.4</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>bintray-kotlin-kotlin-dev</id>
        <name>kotlin-dev</name>
        <url>http://dl.bintray.com/kotlin/kotlin-dev</url>
    </repository>
</repositories>

Gradle

repositories { 
    maven { url "http://dl.bintray.com/kotlin/kotlin-dev" } 
}

dependencies {
    compile 'org.jetbrains.kotlinx:kotlin-sockets:0.0.4'
}

Examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].