anchor.diff:              {exit, Reason, State#st{pending=[Pending|Out]}}
       end.
   
  -%% This magic number is the tcp-over-ethernet MSS (1460) minus the 4 byte
  -%% header of the Publish frame. The idea is that we want to flush just before
  -%% exceeding the MSS.
  +%% This magic number is the tcp-over-ethernet MSS (1460)
  +%% The idea is that we want to flush just before exceeding the MSS.
   -define(FLUSH_THRESHOLD, 1456).
   maybe_flush(#st{pending=Pending} = State) ->
       case iolist_size(Pending) >= ?FLUSH_THRESHOLD of
  
positive.code:     _ = internal_flush(State),
      teardown(State, Reason).
  
  teardown(#st{socket=Socket}, Reason) ->
      case Reason of
          normal ->
              lager:debug("[~p] session normally stopped", [self()]);
  
negative.code:         _ ->
              lager:warning("[~p] session stopped abnormally due to '~p'", [self(), Reason])
      end,
      _ = vmq_exo:decr_socket_count(),
      ok.
  
  proto_tag(ranch_tcp) -> {tcp, tcp_closed, tcp_error};
  proto_tag(ranch_ssl) -> {ssl, ssl_closed, ssl_error}.
  
  active_once({ssl, Socket}) ->
      ssl:setopts(Socket, [{active, once}]);
  