anchor.diff:              #state{keepalive = Keepalive} = State) ->
       {reply, {ok, Keepalive, NewKeepalive},
        State#state{keepalive = NewKeepalive}};
  +
  +handle_call(get_active, _From, #state{active = Active} = State) ->
  +    {reply, Active, State};
  +handle_call({set_active, Active}, _From, State) ->
  +    {reply, ok, State#state{active = Active}};
  +
  +handle_call(recv, _From, State) ->
  +    {Reply, NS} = handle_recv(State),
  +    {reply, Reply, NS};
  +
   handle_call(stop, _From, #state{} = State) ->
       StreamEnd = escalus_stanza:stream_end(),
       NewState = send0(transport(State), exml:to_iolist(StreamEnd), State),
  
positive.code:          get_rid/1,
           get_keepalive/1,
           set_keepalive/2,
           pause/2]).
  
  -define(WAIT_FOR_SOCKET_CLOSE_TIMEOUT, 200).
  -define(SERVER, ?MODULE).
  
negative.code: pause(#transport{rcv_pid = Pid} = Transport, Seconds) ->
      gen_server:cast(Pid, {pause, Transport, Seconds}).
  
  %% get_-/set_active tries to tap into the intuition gained from using
  %% inet socket option {active, true | false | once}.
  %% An active BOSH transport sends unpacked stanzas to an escalus client,
  %% where they can be received using wait_for_stanzas.
  %% An inactive BOSH transport buffers the stanzas in its state.
  %% They can be retrieved using escalus_bosh:recv.
  %%
  %% Sometimes it's necessary to intercept the whole BOSH wrapper
  %% not only the wrapped stanzas. That's when this mechanism proves useful.
  get_active(#transport{rcv_pid = Pid}) ->
      gen_server:call(Pid, get_active).
  
  set_active(#transport{rcv_pid = Pid}, Active) ->
      gen_server:call(Pid, {set_active, Active}).
  
  -spec recv(#transport{}) -> xmlstreamelement() | empty.
  recv(#transport{rcv_pid = Pid}) ->
      gen_server:call(Pid, recv).
  
  %%%===================================================================
  %%% gen_server callbacks
  %%%===================================================================
  