anchor.diff:      <<H1,H2>> = Port,
       H1 * 256 + H2.
   
  +
  +ip_cache(IP_map) ->
  +    receive
  +        {'get',Host, Pid} -> 
  +            IP = maps:get(Host,IP_map,undefined),
  +            Pid ! {self(), IP},
  +            ip_cache(IP_map);
  +        {'remove', Host} ->
  +            M2 = maps:remove(Host, IP_map),
  +            ip_cache(M2);
  +        {'cache', Host, IP} ->
  +            M2 = maps:put(Host,{IP, tis()},IP_map),
  +            ip_cache(M2)
  +    end.
  +
  +store_ip(Host, IP) ->
  +    Pid = whereis(cache),
  +    Pid ! {'cache',Host, IP}.
  +
  +get_ip(Host) ->
  +    Pid = whereis(cache),
  +    Pid ! {'get', Host , self()},
  +    receive
  +        {Pid,undefined} -> undefined;
  +        {Pid, {IP, Time}} ->
  +            CurrentTime = tis(),
  +            if 
  +                CurrentTime - Time > 30 ->
  +                    Pid ! {'remove', Host},
  +                    undefined;
  +               true -> IP
  +            end;
  +        _Any -> info_msg("error here ~p~n",[_Any])
  +    end.
  +
  +tis() ->
  +    calendar:datetime_to_gregorian_seconds(calendar:local_time()).
  +    
  
positive.code: 
  
  %% T represent the state of the sock connection, init -> hello -> reply
  
  -module(entry).
  -export([start_socks/0,start_socks/1]).
  
  -define(INIT, init).
  -define(HELLO, hello).
  
negative.code:     %%io:format("start to receive data from socket ~p, state = ~p~n", [S, T]),
      {C, Data} = gen_tcp:recv(S, 0, infinity),
      case C of
          ok -> %%io:format("received data  = ~p~n",[Data]),
              {State, Addr} = handle_connection_request(S, T, Data, A),
              loop(S, State, Addr);
          error -> io:format("loop, Reason = ~p~n",[Data]),gen_tcp:close(S)
  