anchor.diff:  
   close_local_socket(LS) ->
       Pid = get(LS),
  -    gen_tcp:close(LS),
       case Pid of
  -        undefined -> ok;
  +        undefined ->
  +            gen_tcp:close(LS),
  +            ok;
           _Any ->
  -            Pid ! close
  +            Pid ! {close, LS}
       end.
   
   
  
positive.code:         {ok, LS, Packet} -> 
              send_packet(LS, Packet),
              async_send_to_local();
          close -> close
      end.
  
  
  
negative.code:             handle_remote_data(RS, LS);
          error -> 
              gen_tcp:close(RS),
              close_local_socket(LS),
              case Packet of
                  closed -> ok;
                  _Any -> error_msg("Failed to retrieve data from remote ~p, Reason = ~p~n",[Addr,Packet])
  