SignalRKore is a Kotlin Multiplatform client library for ASP.NET Core SignalR. It enables real-time communication between clients and servers, allowing server-side code to push content to clients and vice-versa instantly.
Official client library | SignalRKore | |
---|---|---|
Written in | Java | Kotlin |
KMM / KMP | ✖️ | Android, JVM, iOS |
Network | OkHttp only | Ktor |
Async | RxJava | Coroutines |
Serialization | Gson (non-customizable) | Kotlinx Serializable (customizable) |
Streams | ✔️ | ✔️ |
Transport fallback | ✖️ | ✖️ |
Automatic reconnect | ✖️ | ✔️ |
SSE | ✖️ | ✔️ |
Connection status | ✖️ | ✔️ |
Logging | SLF4J | Custom interface |
MsgPack | ✔️ | ✖️ |
Tested by time & community | ✔️ | ✖️ |
// Create a connection
val connection = HubConnectionBuilder.create("http://localhost:5000/chat")
// Start the connection
connection.start()
// Send a message to the server
connection.send("broadcastMessage", "User", "Hello, SignalR!")
// Receive messages from the server
connection.on("broadcastMessage", String::class, String::class).collect { (user, message) ->
println("$user says: $message")
}
// Don't forget to stop the connection when done
connection.stop()
Please see the documentation.
All functionality was possible to implement only thanks to AzureSignalR ChatRoomLocal sample.
SignalRKore is released under the Apache 2.0 license.
- Readme
- Documentation
- Add example project
- Fix up ServerSentEvents' http client
- Add logging
- Error handling
- Add tests
- Implement streams
- Extend to JVM
- Extend to iOS
- Implement transport fallback
- Implement automatic reconnect
- Reacting to stream invocation from server