📜  socket.io kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32             🧑  作者: Mango

代码示例1
//kotlin
import com.github.nkzawa.emitter.Emitter
import com.github.nkzawa.socketio.client.IO
import com.github.nkzawa.socketio.client.Socket

val socket = IO.socket("http://localhost:4000/")

socket.on(Socket.EVENT_CONNECT, Emitter.Listener {
    socket.emit("messages", "hi")
});