Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Distinguish different bullet connections in ping messages.

  • Loading branch information...
commit d4d541a4ea88b5483af2eae5c8e84649ac91c687 1 parent 22ac46d
@jdavisp3 jdavisp3 authored
View
4 examples/clock/src/stream_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]),
View
2  examples/clock/src/toppage_handler.erl
@@ -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.
Something went wrong with that request. Please try again.