anchor.diff:             Error
      end.
   
  +%% @private
   tls_enabled() ->
       partisan_config:get(tls).
   
  +%% @private
   tls_options() ->
       partisan_config:get(tls_options).
  +
  +%% @private
  +send(Transport, Socket, Data) ->
  +    %% Update last transmission time.
  +    put(last_transmission_time, erlang:monotonic_time(millisecond)),
  +
  +    %% Transmit the data on the socket.
  +    Transport:send(Socket, Data).
  +
  +%% Determine if we should transmit:
  +%%
  +%% If theré's another message in the queue, we can skip 
  +%% sending this message.  However, if the arrival rate of 
  +%% messages is too high, we risk starvation where
  +%% we may never send.  Therefore, we must force a transmission 
  +%% after a given period with no transmissions.
  +%%
  +%% @private
  +monotonic_should_send(MessageQueueLen, LastTransmissionTime) ->
  +    case length(MessageQueueLen) > 0 of
  +        true ->
  +            NowTime = erlang:monotonic_time(millisecond),
  +            Diff = abs(NowTime - LastTransmissionTime),
  +
  +            SendWindow = partisan_config:get(send_window, 1000),
  +
  +            case Diff > SendWindow of
  +                true ->
  +                    true;
  +                false ->
  +                    false
  +            end;
  +        false ->
  +            true
  +    end.
positive.code:             {ok, TLSSocket} = ssl:ssl_accept(TCPSocket, TLSOpts),
              %% restore the expected active once setting
              ssl:setopts(TLSSocket, [{active, once}]),
              #connection{socket = TLSSocket, transport = ssl, control = ssl};
          _ ->
              #connection{socket = TCPSocket, transport = gen_tcp, control = inet}
      end.
  
  %% @see gen_tcp:send/2
  %% @see ssl:send/2
  -spec send(connection(), iodata()) -> ok | {error, reason()}.
  send(#connection{socket = Socket, transport = Transport}, Data) ->
      Transport:send(Socket, Data).
  
  %% @see gen_tcp:recv/2
  %% @see ssl:recv/2
  
negative.code: socket(Conn) ->
      Conn#connection.socket.
  
  %% @private
  do_connect(Address, Port, Options, Timeout, Transport, Control) ->
     case Transport:connect(Address, Port, Options, Timeout) of
         {ok, Socket} ->
  