忽略MyApplication.UserSocket中无法匹配的主题“heartbeat”

时间:2018-05-08 17:51:56

标签: elixir phoenix-framework phoenix-channels

这个问题看起来很基本,我绝对无法在教程和文档中找到有关它的任何信息。然而,如果我的客户ping“心跳”(默认情况下iOS和Android客户端都使用心跳),它无效:[warn] Ignoring unmatched topic "heartbeat" in MyApplication.UserSocket

我觉得transport.ex中的这段代码应该简单地回应发送给心跳的任何请求但不知道它不会:

  def dispatch(%{ref: ref, topic: "phoenix", event: "heartbeat"}, _channels, socket) do
    {:reply, %Reply{join_ref: socket.join_ref, ref: ref, topic: "phoenix", status: :ok, payload: %{}}}
  end

我在某处错过了一段配置吗?

我实施的所有其他功能都完美无缺,因此我所有的渠道都有效。

1 个答案:

答案 0 :(得分:0)

我正在使用发送错误心跳消息的过时客户端。之后问题就消失了。