anchor.diff:  %%%===================================================================
   %%% @copyright (C) 2011, Erlang Solutions Ltd.
  -%%% @doc Module abstracting away various socket implementations
  +%%% @doc Module providing basic client functionality
   %%% @end
   %%%===================================================================
   -module(lxmppc).
  
positive.code:     Mod:stop(Transport).
  
  %%%===================================================================
  %%% Helpers
  %%%===================================================================
  
  get_module(tcp) ->
      lxmppc_socket_tcp.
  
negative.code: -include_lib("exml/include/exml_stream.hrl").
  -include("lxmppc.hrl").
  
  %% High-level API
  -export([start/1,
           stop/1]).
  
  %% Low-level API
  -export([connect/2,
           send/2,
           reset_stream/1,
           is_connected/1]).
  
  -define(TIMEOUT, 1000).
  
  %%%===================================================================
  %%% Public API
  %%%===================================================================
  
  start(Props) ->
      %% TODO: change getting defaults when implementing BOSH
      Type = proplists:get_value(transport, Props, tcp),
      Server = proplists:get_value(server, Props, <<"localhost">>),
      Host = proplists:get_value(host, Props, Server),
      Port = proplists:get_value(port, Props, 5222),
      try
          NewProps = lists:keystore(host, 1, Props, {host, Host}),
          start_connect(Type, Host, Port, NewProps)
      catch Error ->
          {error, Error}
      end.
  
  
  connect(Type, Args) ->
      Mod = get_module(Type),
  