     """
   end
 
-  defp warn_unexpected_msg(fun, arity, msg) do
+  defp warn_unexpected_msg(fun, arity, msg, channel) do
     proc =
       case Process.info(self(), :registered_name) do
         {_, []} -> self()

    ref = make_ref()
    from = {self(), ref}
    child_spec = channel.child_spec({socket.endpoint, from})
    
    case starter.(socket.endpoint, socket.handler, from, child_spec) do
      {:ok, pid} ->
        send(pid, {Phoenix.Channel, payload, from, socket})


    :error_logger.warning_msg(
      ~c"~p ~p received unexpected message in #{fun}/#{arity}: ~p~n",
      [channel, proc, msg]
    )
  end
end
