socket.io kotlin
snippet in kotlin

socket.io kotlin

user6494

//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")
});