anchor.diff:  reply_to_ack_requests({true,H,inactive}, _, _) -> {true, H, inactive};
   reply_to_ack_requests({true, H0, active}, Acks, State) ->
       {true,
  -     lists:foldl(fun({Ack,H}, _) -> raw_send(State, Ack), H end,
  +     % TODO: Maybe compress here?
  +     lists:foldl(fun({Ack,H}, _) -> raw_send(exml:to_iolist(Ack), State), H end,
                    H0, Acks),
        active}.
   
  -raw_send(#state{socket=Socket, ssl=true}, Elem) ->
  -    ssl:send(Socket, exml:to_iolist(Elem));
  -raw_send(#state{socket=_Socket, compress=true}, _Elem) ->
  -    throw({escalus_tcp, auto_ack_not_implemented_for_compressed_streams});
  -raw_send(#state{socket=Socket}, Elem) ->
  -    gen_tcp:send(Socket, exml:to_iolist(Elem)).
  +maybe_compress_and_send(Data, #state{ compress = {zlib, {_, Zout}} } = State) ->
  +    raw_send(zlib:deflate(Zout, Data, sync), State);
  +maybe_compress_and_send(Data, State) ->
  +    raw_send(Data, State).
  +
  +raw_send(Data, #state{socket = Socket, ssl = true}) ->
  +    ssl:send(Socket, Data);
  +raw_send(Data, #state{socket = Socket}) ->
  +    gen_tcp:send(Socket, Data).
   
   common_terminate(_Reason, #state{parser = Parser}) ->
       exml_stream:free_parser(Parser).
  
positive.code:     {ok, Pid} = gen_server:start_link(?MODULE, [Opts1, self()], []),
      Pid.
  
  -spec send(pid(), exml:element()) -> ok.
  send(Pid, Elem) ->
      gen_server:cast(Pid, {send, Elem}).
  
  -spec is_connected(pid()) -> boolean().
  is_connected(Pid) ->
  
negative.code: -behaviour(escalus_connection).
  
  -include_lib("exml/include/exml_stream.hrl").
  -include_lib("exml/include/exml.hrl").
  -include("escalus.hrl").
  
  %% API exports
  