Skip to content

Instantly share code, notes, and snippets.

@aksel
Last active February 12, 2021 11:35
Show Gist options
  • Select an option

  • Save aksel/b3e986e2aa14ac78ec3fde87bd960312 to your computer and use it in GitHub Desktop.

Select an option

Save aksel/b3e986e2aa14ac78ec3fde87bd960312 to your computer and use it in GitHub Desktop.

Revisions

  1. aksel renamed this gist Aug 5, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Kotlin SocketIO example → Kotlin Socket.IO example
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    import io.socket.client.IO
    import io.socket.client.Socket

    fun connect() {
    val socket = IO.socket("http://localhost:4000?user=aksel")
    socket.connect()
  2. aksel created this gist Aug 5, 2017.
    6 changes: 6 additions & 0 deletions Kotlin SocketIO example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    fun connect() {
    val socket = IO.socket("http://localhost:4000?user=aksel")
    socket.connect()
    .on(Socket.EVENT_CONNECT, { println("connected") })
    .on(Socket.EVENT_DISCONNECT, { println("disconnected") })
    }