anchor.diff:  -include("bkdcore.hrl").
   -compile([{parse_transform, lager_transform}]).
   % API
  --export([call/2,cast/2,async_call/3,multicall/2,is_connected/1]).
  +-export([call/2,cast/2,async_call/3,multicall/2,is_connected/1,isolate/2]).
   % gen_server
   -export([start/0,start/1,start/2, stop/1,stop/0, init/1, handle_call/3,
   		  handle_cast/2, handle_info/2, terminate/2, code_change/3,t/0]).
  
positive.code: -record(dp,{sock,sendproc,calln = 0,callsininterval = 0, callcount = 0,
  			respawn_timer = 0, iteration = 0,
  			permanent = false, direction,transport, tunnelstate,
  			isinit = false, connected_to,tunnelmod, reconnecter}).
  
  handle_call(_Msg,_,#dp{direction = sender, sock = undefined} = P) ->
  	{reply,{error,econnrefused},P};
  
negative.code: 			exit(false)
  	end.
  
  exec_gather(Isolated,Home,Bin) ->
  	erlang:monitor(process,Home),
  	exec_sum(Isolated,Home,Bin).
  exec_sum(I,Home,Bin) ->
  	receive
  		{chunk,C} ->
  			exec_sum(I,Home,<<Bin/binary,C/binary>>);
  		{'DOWN',_Monitor,_,Home,_Reason} ->
  			ok;
  		{done,C} ->
  			exec(I,Home,<<Bin/binary,C/binary>>)
  	end.
  
  exec(true,Home,_Msg) ->
  	gen_server:call(Home,{reply,term_to_binary({rpcreply,{error,closed}},[compressed,{minor_version,1}])});
  exec(_,Home,Msg) ->
  	case binary_to_term(Msg) of
  		{rpcreply,{From,X}} ->
  			gen_server:reply(From,X),
  