Skip to content

Commit

Permalink
Sending pong message over websocket, MyMedsAndMe#48
Browse files Browse the repository at this point in the history
  • Loading branch information
Zatvobor committed Jul 17, 2016
1 parent 1692ba0 commit 5f055dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/spell/transport/websocket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ defmodule Spell.Transport.WebSocket do
{:ok, state}
end

def websocket_handle({:ping, raw_message}, _conn_state, state) do
Logger.debug(fn -> "Sending pong message over websocket: #{inspect(raw_message)}" end)
{:reply, {:pong, raw_message}, state}
end

def websocket_info({:send, raw_message}, _conn_state, state) do
Logger.debug(fn -> "Sending message over websocket: #{inspect(raw_message)}" end)
{:reply, {state.serializer_info.frame_type, raw_message}, state}
Expand Down

0 comments on commit 5f055dc

Please sign in to comment.