问题描述
有人可以告诉我我在做什么错
private fun getTorrentsSocketIO() {
coroutineScope.launch {
try {
val socket = IO.socket("...")
socket.on("torrents") {
val jsonString = it.toList() as List<Torrent>
_torrents.value = jsonString
}
socket.connect()
} catch (t: Throwable) {
Log.i("LIST_VIEW_MODEL",t.message.toString())
}
}
}
调用以下内容时引发错误
_torrents.value = jsonString