anchor.diff:  connect_failed_str(Reason) ->
       f("Connect failed: ~w", [Reason]).
   
  +listen_failed_str(Reason) ->
  +    f("Listen failed: ~w", [Reason]).
  +
  +accept_failed_str(Reason) ->
  +    f("Accept failed: ~w", [Reason]).
  +
   formated_timestamp() ->
       format_timestamp(os:timestamp()).
   
  
positive.code: %% Fill send queue and then start receiving.
  %%
  busy_send(Config) when is_list(Config) ->
      Master = self(),
      Msg = <<"the quick brown fox jumps over a lazy dog~n">>,
      Server =
  	spawn_link(fun () ->
  			   {ok,L} = gen_tcp:listen
  				      (0, [{active,false},binary,
  					   {reuseaddr,true},{packet,0}]),
  			   {ok,Port} = inet:port(L),
  			   Master ! {self(),client,
  				     busy_send_client(Port, Master, Msg)},
  			   busy_send_srv(L, Master, Msg)
  		   end),
      io:format("~p Server~n", [Server]),
      receive
          {Server,client,Client} ->
              io:format("~p Client~n", [Client]),
              busy_send_loop(Server, Client, 0)
      end.
  
  busy_send_loop(Server, Client, N) ->
      %% Master
      %%
      receive {Server,send} ->
  		  busy_send_loop(Server, Client, N+1)
  	  after 2000 ->
  		  %% Send queue full, sender blocked 
  		  %% -> stop sender and release client
  		  io:format("Send timeout, time to receive...~n", []),
  		  Server ! {self(),close},
  		  Client ! {self(),recv,N+1},
                    receive
                        {Server,send} ->
                            busy_send_2(Server, Client, N+1)
                    after 10000 ->
                              %% If this happens, see busy_send_srv
                              ct:fail({timeout,{server,not_send,flush([])}})
                    end
      end.
  
  busy_send_2(Server, Client, _N) ->
      %% Master
      %%
      receive
          {Server,[closed]} ->
              receive {Client,[0,{error,closed}]} -> ok end
      after 10000 ->
                ct:fail({timeout,{server,not_closed,flush([])}})
      end.
  
  busy_send_srv(L, Master, Msg) ->
  
negative.code:     %% Sometimes this accept does not return, do not really know why
      %% but is causes the timeout error in busy_send_loop to be
      %% triggered. Only happens on OS X Leopard?!?
      case gen_tcp:accept(L) of
          {ok, Socket} ->
              p("[server] accepted"),
              busy_send_srv_loop(Socket, Master, Msg);
          {error, Reason} ->
              p("UNEXPECTED: server accept failure: ~p", [Reason]),
              exit({skip, accept_failed_str(Reason)})
      end.
  
  busy_send_srv_loop(Socket, Master, Msg) ->
      %% Server
      %%
      receive
  	{Master, close} ->
              p("[server] received close"),
  	    ok = gen_tcp:close(Socket),
  	    Master ! {self(),flush([closed])}
      after 0 ->
  	    ok = gen_tcp:send(Socket, Msg),
  	    Master ! {self(), send},
  	    busy_send_srv_loop(Socket, Master, Msg)
      end.
  
  %% busy_send_client(Port, Master, Msg) ->
  %%     %% Client
  %%     %%
  %%     spawn_link(
  %%       fun () ->
  %% 	      {ok,Socket} = gen_tcp:connect(
  %% 			 "localhost", Port,
  %% 			 [{active,false},binary,{packet,0}]),
  %% 	      receive
  %% 		  {Master,recv, N} ->
  %% 		      busy_send_client_loop(Socket, Master, Msg, N)
  %% 	      end
  %%       end).
  
  busy_send_client_loop(Socket, Master, Msg, N) ->
      %% Client
      %%
      Size = byte_size(Msg),
      case gen_tcp:recv(Socket, Size) of
  	{ok, Msg} ->
  	    busy_send_client_loop(Socket, Master, Msg, N-1);
  	Other ->
  	    Master ! {self(), flush([Other,N])}
      end.
  
  %%%
  