anchor.diff:          {_,            _} -> run_socket(State)
       end.
   
  -received_stats(?PACKET(Type)) ->
  -    emqttd_metrics:inc('packets/received'), inc(Type).
  -inc(?CONNECT) ->
  -    emqttd_metrics:inc('packets/connect');
  -inc(?PUBLISH) ->
  -    emqttd_metrics:inc('messages/received'),
  -    emqttd_metrics:inc('packets/publish/received');
  -inc(?SUBSCRIBE) ->
  -    emqttd_metrics:inc('packets/subscribe');
  -inc(?UNSUBSCRIBE) ->
  -    emqttd_metrics:inc('packets/unsubscribe');
  -inc(?PINGREQ) ->
  -    emqttd_metrics:inc('packets/pingreq');
  -inc(?DISCONNECT) ->
  -    emqttd_metrics:inc('packets/disconnect');
  -inc(_) ->
  -    ignore.
  -
  
positive.code:                                conn_name   = ConnStr}) ->
      case Parser(Bytes) of
      {more, NewParser} ->
          {noreply, control_throttle(State #state{parser = NewParser}), hibernate};
      {ok, Packet, Rest} ->
          received_stats(Packet),
          case emqttd_protocol:received(Packet, ProtoState) of
          {ok, ProtoState1} ->
              received(Rest, State#state{parser = emqttd_parser:new(PacketOpts),
  
negative.code:     network_error(Reason, State);
  
  handle_info({inet_reply, _Sock, {error, Reason}}, State = #state{peername = Peername}) ->
      lager:error("Client(~s): unexpected inet_reply '~p'", [emqttd_net:format(Peername), Reason]),
      {noreply, State};
  
  handle_info({keepalive, start, TimeoutSec}, State = #state{transport = Transport, socket = Socket, peername = Peername}) ->
      lager:debug("Client(~s): Start KeepAlive with ~p seconds",
                    [emqttd_net:format(Peername), TimeoutSec]),
      StatFun = fun() ->
              case Transport:getstat(Socket, [recv_oct]) of
                  {ok, [{recv_oct, RecvOct}]} -> {ok, RecvOct};
  