Skip to content

Commit

Permalink
fix sample
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information
ibdknox committed Apr 30, 2011
1 parent d93463b commit 5d04dc5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/echo.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
(ns clj-socketio.examples.echo
(:use clj-socketio.core))

(def server (create 8080))
(def clients (atom #{}))

(on-connected (fn [client]
(swap! clients conj client)))
(on-connected server (fn [client]
(swap! clients conj client)))

(on-disconnect (fn [client]
(swap! clients disj client)))
(on-disconnect server (fn [client]
(swap! clients disj client)))

(on-message (fn [client msg]
(println msg)))
(on-message server (fn [client msg]
(println msg)))

(start server)

0 comments on commit 5d04dc5

Please sign in to comment.