问题描述
我正在制作一个小型的服务器端应用程序,该应用程序将通过WebSockets与浏览器进行通信,并正在考虑使用Kotlin编写它.
I'm making a small server-side application that will communicate with a browser via WebSockets, and am considering writing it in Kotlin.
是否存在与Kotlin配合使用的WebSockets API,或者该Java WebSockets API符合要求吗?
Is there a WebSockets API that works particularly well with Kotlin, or will any Java WebSockets API fit the bill?
推荐答案
此库适用于我在科特林很好.实际上,大多数Java库对于Kotlin来说对我来说都很好.
This library worked for me very well in Kotlin. Actually, most java libraries worked well for me with Kotlin.
更新最近发布了模块. /square.github.io/okhttp/"rel =" nofollow> OkHttp 支持WebSocket的库.这是一个Beta版本,但我可以尝试一下,因为OkHttp本身可以很好地与Kotlin配合使用.
UpdateThere was recently released a module for OkHttp library that supports WebSockets. It's a beta version but I would give it a try since OkHttp itself works well with Kotlin.
这篇关于Kotlin和WebSockets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!