   # -------------------------------------------------------------------
 
   @doc "Starts the socket process."
-  @spec start_link(callback::module, transport::module, any, socket_opts, GenServer.options) :: GenServer.on_start
-  def start_link(callback, transport, arg, socket_opts \\ [], gen_server_opts \\ []) do
-    GenServer.start_link(__MODULE__, {callback, transport, arg, socket_opts}, gen_server_opts)
+  @spec start_link(callback::module, transport_mod::module, any, socket_opts, GenServer.options) ::
+      GenServer.on_start
+  def start_link(callback, transport_mod, arg, socket_opts \\ [], gen_server_opts \\ []) do
+    GenServer.start_link(__MODULE__, {callback, transport_mod, arg, socket_opts}, gen_server_opts)
   end
 
   @doc "Joins the topic."

  end

  defp transport(state),
    do: Map.take(state, [:transport, :transport_pid, :message_refs, :serializer])

  defp next_ref(topic, message_refs),
    do: :ets.update_counter(message_refs, topic, 1, {topic, 0})

        {:error, :already_joined}
      true ->
        frame = transport.serializer.encode_message(%{topic: topic, event: event, payload: payload, ref: ref})
        transport.transport_mod.push(transport.transport_pid, frame)
        {:ok, ref}
    end
  end
