Permalink
Browse files

Distinguish different bullet connections in ping messages.

  • Loading branch information...
1 parent 22ac46d commit d4d541a4ea88b5483af2eae5c8e84649ac91c687 @jdavisp3 jdavisp3 committed Jun 9, 2013
Showing with 3 additions and 3 deletions.
  1. +2 −2 examples/clock/src/stream_handler.erl
  2. +1 −1 examples/clock/src/toppage_handler.erl
@@ -15,8 +15,8 @@ init(_Transport, Req, _Opts, _Active) ->
TRef = erlang:send_after(?PERIOD, self(), refresh),
{ok, Req, TRef}.
-stream(<<"ping">>, Req, State) ->
- io:format("ping received~n"),
+stream(<<"ping: ", Name/binary>>, Req, State) ->
+ io:format("ping ~p received~n", [Name]),
{reply, <<"pong">>, Req, State};
stream(Data, Req, State) ->
io:format("stream received ~s~n", [Data]),
@@ -51,7 +51,7 @@ $(document).ready(function(){
};
bullet.onheartbeat = function(){
console.log('ping: ' + name);
- bullet.send('ping');
+ bullet.send('ping: ' + name);
}
};

0 comments on commit d4d541a

Please sign in to comment.