anchor.diff:  
   setopts(Swocket) ->
       inet:setopts(Swocket, [{active, 300}, {packet, 0}, binary]).
  +
  +process_packet([H|T], #state{socket = Socket} = State) ->
  +    case H of
  +        {<<"r">>, Attrs} ->
  +            {<<"id">>, MsgId} = lists:keyfind(<<"id">>, 1, Attrs),
  +            log:i("Got r id=~p~n", [MsgId]),
  +
  +            RR = case lists:keyfind(<<"c">>, 1, Attrs) of
  +                {<<"c">>, <<"login">>} ->
  +                    {<<"user">>, UserInfo} = lists:keyfind(<<"user">>, 1, Attrs),
  +                    {ok, User} = parse_user_info(UserInfo),
  +                    session_manager:register(User, self()),
  +                    NewState = State#state{user = User},
  +                    <<"[rr] id=\"", MsgId/binary, "\" c=\"success\"">>;
  +                _ ->
  +                    NewState = State,
  +                    <<"[rr] id=\"", MsgId/binary, "\" c=\"error\"">>
  +            end,
  +            gen_tcp:send(Socket, RR);
  +        {<<"m">>, Attrs} = Msg ->
  +            send_ack(Socket, Attrs),
  +
  +            case lists:keyfind(<<"to">>, 1, Attrs) of
  +                {<<"to">>, ToUserInfo} ->
  +                    {ok, ToUser} = parse_user_info(ToUserInfo),
  +                    send_msg_2_single_user(ToUser#user.id, Msg);
  +                _ ->
  +                    ignore
  +            end,
  +            NewState = State;
  +        {<<"gm">>, Attrs} = Msg ->
  +            send_ack(Socket, Attrs),
  +
  +            case lists:keyfind(<<"group">>, 1, Attrs) of
  +                {<<"group">>, [{<<"id">>, GroupId}]} ->
  +                    % UserIdList = group:get_user_id_list(GroupId),
  +                    UserIdList = [<<"22">>, <<"23">>],
  +                    send_msg_2_multiple_users(UserIdList, Msg);
  +                _ ->
  +                    ignore
  +            end,
  +            NewState = State;
  +        {<<"a">>, Attrs} ->
  +            % hack:offline
  +            {<<"id">>, MsgId} = lists:keyfind(<<"id">>, 1, Attrs),
  +            NewState = State
  +    end,
  +    process_toml(T, NewState);
  +process_packet([], NewState) ->
  +    {ok, NewState}.
   
   % [{<<"device">>,<<"android">>},{<<"id">>,<<"1">>}]
   parse_user_info(UserInfo) ->
  
positive.code:     H ! {m, Msg},
      send_msg_to_pid(T, Msg);
  send_msg_to_pid([], _) ->
      ok.
negative.code: 
  handle_info({tcp, Socket, Data}, #state{socket = Socket} = State) ->
      {ok, Toml} = etoml:parse(Data),
      {ok, NewState} = process_packet(Toml, State),
      {noreply, NewState, NewState#state.heartbeat_timeout};
  % tcp connection change to passive
  handle_info({tcp_passive, Swocket}, #state{socket = Swocket} = State) ->
  