anchor.diff:      {ok,A} = gen_tcp:accept(L),
       gen_tcp:send(A,"Hello"),
       {ok, "Hello"} = Remote(fun() -> gen_tcp:recv(C,0) end),
  -    Loop2 = fun(_,_,0) ->
  -		    {failure, timeout};
  -	       (L2,F2,N) ->
  -		    Ret = F2(),
  -		    io:format("~p~n",[Ret]),
  -		    case Ret of
  -			ok -> receive after 1 -> ok end,
  -			      L2(L2,F2,N-1);
  -			Other -> Other
  -		    end
  -	    end,
  -    Loop = fun(F3) ->  Loop2(Loop2,F3,1000) end,
  -    {Loop,A,R}.
  -
  -setup_active_timeout_sink(Timeout, AutoClose) ->
  -    Dir = filename:dirname(code:which(?MODULE)),
  -    {ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
  -                                    [{args,"-pa " ++ Dir}]),
  +    A.
  +
  +setup_active_timeout_sink(RNode, Timeout, AutoClose) ->
       Host = get_hostname(node()),
  -    {ok, L} = gen_tcp:listen(0, [binary,{active,false},{packet,0},{nodelay, true},{keepalive, true},
  -				 {send_timeout,Timeout},
  -				 {send_timeout_close,AutoClose}]),
  +    ListenOpts =  [binary,{active,false},{packet,0},
  +		   {nodelay,true},{keepalive,true},
  +		   {send_timeout,Timeout},{send_timeout_close,AutoClose}],
  +    {ok, L} = gen_tcp:listen(0, ListenOpts),
       Fun = fun(F) ->
   		  receive
   		      {From,X} when is_function(X) ->
  -			  From ! {self(),X()}, F(F);
  +			  From ! {self(),X()},
  +			  F(F);
   		      die -> ok
   		  end
   	  end,
  -    Pid =  rpc:call(R,erlang,spawn,[fun() -> Fun(Fun) end]),
  +    Pid = rpc:call(RNode, erlang, spawn, [fun() -> Fun(Fun) end]),
       {ok, Port} = inet:port(L),
       Remote = fun(Fu) ->
   		     Pid ! {self(), Fu},
  
positive.code:    
  %% Test the send_timeout socket option.
  send_timeout(Config) when is_list(Config) ->
      %% Basic
      BasicFun =
  	fun(AutoClose) ->
  	     {Loop,A,RNode} = setup_timeout_sink(1000, AutoClose),
  	     {error,timeout} =
  		 Loop(fun() ->
  			      Res = gen_tcp:send(A,<<1:10000>>),
  			      %%erlang:display(Res),
  			      Res
  		      end),
  	     %% Check that the socket is not busy/closed...
  	     Error = after_send_timeout(AutoClose),
  	     {error,Error} = gen_tcp:send(A,<<"Hej">>),
  	     test_server:stop_node(RNode)
  	end,
      BasicFun(false),
      BasicFun(true),
      %% Check timeout length
      Self = self(),
      Pid = spawn(fun() ->
                          {Loop,A,RNode} = setup_timeout_sink(1000, true),
                          {error,timeout} = Loop(fun() ->
                                       Res = gen_tcp:send(A,<<1:10000>>),
                                       %%erlang:display(Res),
                                       Self ! Res,
                                       Res
                               end),
                          test_server:stop_node(RNode)
  	      end),
      Diff = get_max_diff(),
      io:format("Max time for send: ~p~n",[Diff]),
      true = (Diff > 500) and (Diff < 1500),
      %% Let test_server slave die...
      Mon = erlang:monitor(process, Pid),
      receive {'DOWN',Mon,process,Pid,_} -> ok end,
      %% Check that parallell writers do not hang forever
      ParaFun =
  	fun(AutoClose) ->
  		{Loop,A,RNode} = setup_timeout_sink(1000, AutoClose),
  		SenderFun = fun() ->
  				    {error,Error} =
  					Loop(fun() ->
  						     gen_tcp:send(A, <<1:10000>>)
  					     end),
  				    Self ! {error,Error}
  			    end,
  		spawn_link(SenderFun),
  		spawn_link(SenderFun),
                  receive
                      {error,timeout} -> ok
                  after 10000 ->
                            exit(timeout)
                  end,
  		NextErr = after_send_timeout(AutoClose),
                  receive
                      {error,NextErr} -> ok
                  after 10000 ->
                            exit(timeout)
                  end,
  		{error,NextErr} = gen_tcp:send(A,<<"Hej">>),
  		test_server:stop_node(RNode)
  	end,
      ParaFun(false),
      ParaFun(true),
      ok.
  
  mad_sender(S) ->
  
negative.code: 		      die -> ok
  		  end
  	  end,
      Pid =  rpc:call(RNode, erlang, spawn, [fun() -> Fun(Fun) end]),
      {ok, Port} = inet:port(L),
      Remote = fun(Fu) ->
  		     Pid ! {self(), Fu},
  