anchor.diff:          , send_resp/2
   		]).
   
  +start_srv(HostIf, Port) when is_integer(Port) ->
  +    {ok, IfIpAddr} = inet:getaddr(HostIf, inet),
  +    gen_server:call(?MODULE, {start_listen, IfIpAddr, Port}).
  +
  +stop_srv() -> gen_server:call(?MODULE, {stop_listen}).
  +
   start_link(Params) ->
   	gen_server:start_link({local, ?MODULE}, ?MODULE, Params, []).
   
  -init([Sock, NativeIfMod, IsSec]) ->
  +init([Sock, true]) ->
       io:format("~p tcp client ~p~n", [self(), Sock]),
  -    {ok, #state{csock=Sock, native_if_mod=NativeIfMod, is_secure=IsSec}};
  +    {ok, #state{csock=Sock}};
   init(Params) ->
       {_, Interface} = lists:keyfind(tcp_ip,1,Params),
       {_, ListenPort} = lists:keyfind(tcp_port,1,Params),
  -    {_, NativeIfMod} = lists:keyfind(if_mod,1,Params),
  -    {_, IsSec} = lists:keyfind(if_sec,1,Params),
       case inet:getaddr(Interface, inet) of
           {error, Reason} ->
               {stop, Reason};
  
positive.code:                 {ok, LSock} ->
                      io:format("~p started imem_server ~p @ ~p~n", [self(), LSock, {ListenIf, ListenPort}]),
                      gen_server:cast(self(), accept),
                      {ok, #state{lsock=LSock, native_if_mod=NativeIfMod, is_secure=IsSec}};
                  Reason ->
                      io:format("~p imem_server not started ~p~n", [self(), Reason]),
                      {ok, #state{}}
              end;
          _ ->
              {stop, disabled}
      end.
  
  handle_call(_Request, _From, State) ->
      % io:format("handle_call ~p~n", [_Request]),
      {reply, ok, State}.
  
  handle_cast(accept, #state{lsock=LSock, native_if_mod=NativeIfMod, is_secure=IsSec}=State) ->
      {ok, Sock} = gen_tcp:accept(LSock),
      % io:format("accept conn ~p~n", [Sock]),
      {ok,Pid} = gen_server:start(?MODULE, [Sock, NativeIfMod, IsSec], []),
      ok = gen_tcp:controlling_process(Sock, Pid),
      gen_server:cast(Pid, activate),
      gen_server:cast(self(), accept),
  
negative.code:     % io:format("handle_cast ~p~n", [_Msg]),
  	{noreply, State}.
  
  handle_info({tcp, Sock, Data}, #state{buf=Buf}=State) ->
      ok = inet:setopts(Sock, [{active, once}]),
      NewBuf = <<Buf/binary, Data/binary>>,
      Res = (catch binary_to_term(NewBuf)),
  