Created
April 8, 2011 18:08
-
-
Save casualjim/910404 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mojolly.backchat | |
package web | |
class MySocketIOClient extends Client { | |
def receive = { | |
case Connected => { | |
} | |
case Message(msg) => { | |
//handlePlainTextMessage | |
} | |
case JsonMessage(msg) => //handleJsonMessage(msg) | |
case Disconnected(_, _) => { | |
// do stuff on disconnect | |
} | |
case m => log.warn("Unknown message format found: %s", m) | |
} | |
} | |
class SocketIOApp extends ScalatraServlet with SocketIOSupport with Logging { | |
get("/?") { | |
"Hello, I don't do anything but serve websockets. Visit https://backchat.io for more information." | |
} | |
connect { | |
new MySocketIOClient | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment