     {:noreply, s}
   end
 
-  def handle_call({:operation, op_name, mode, args} = msg, from, s)
-      when mode in [:sync, :async] do
-    handle_call({:operation, op_name, args}, from, s)
-  end
-
-  def handle_call({:operation, op_name, :no_response, args}, from, %{session_id: sid} = s) do
-    req = Protocol.encode_op(op_name, [sid|args])
-
-    s = update_in(s.queue, &:queue.in({from, op_name, :no_response}, &1))
-
-    :gen_tcp.send(s.socket, req)
-    {:reply, :ok, s}
-  end
-
   @doc false
   def handle_info(msg, state)
 

    # Reactivate the socket.
    :inet.setopts(socket, active: :once)

    {{:value, queued}, new_queue} = :queue.out(s.queue)

    {from, op_name, no_response?} =
      case queued do
        {from, op_name}               -> {from, op_name, false}
        {from, op_name, :no_response} -> {from, op_name, true}
      end

    s = %{s | queue: new_queue}

    resp = case Protocol.parse_resp(op_name, msg, s.opts[:token?]) do
      {:ok, ^sid, resp}         -> resp
      {:ok, ^sid, _token, resp} -> resp
    end

    unless no_response? do
      Connection.reply(from, resp)
    end

    {:noreply, s}
  end


  def start_link(opts \\ []) do
    opts = Keyword.merge(@default_opts, opts)
    Connection.start_link(__MODULE__, opts)
  end

  def operation(pid, op_name, args) do
