anchor.diff:  	    end,
       ?line {ok,L2} = prim_inet:getstatus(LS),
       ?line true  = lists:member(accepting, L2),
  -    ?line ok = ?EXPECT_ACCEPTS([{Pid2,{error,timeout}}],1000),
  +    ?line ok = ?EXPECT_ACCEPTS([{Pid2,{error,timeout}}],1,1000),
       ?line {ok,L3} = prim_inet:getstatus(LS),
       ?line false  = lists:member(accepting, L3),
       ok.
  
positive.code:     ?line Parent = self(),
      ?line F = fun() -> Parent ! {accepted,self(),gen_tcp:accept(LS,1000)} end,
      ?line P = spawn(F),
      ?line ?EXPECT_ACCEPTS([{P,{error,timeout}}],2000).
  
  accept_timeouts_in_order(suite) ->
      [];
  accept_timeouts_in_order(doc) ->
      ["Check that multi-accept timeouts happen in the correct order"];
  accept_timeouts_in_order(Config) when is_list(Config) ->
      ?line {ok,LS}=gen_tcp:listen(0,[]),
      ?line Parent = self(),
      ?line P1 = spawn(mktmofun(1000,Parent,LS)),
      ?line P2 = spawn(mktmofun(1200,Parent,LS)),
      ?line P3 = spawn(mktmofun(1300,Parent,LS)),
      ?line P4 = spawn(mktmofun(1400,Parent,LS)),
      ?line ?EXPECT_ACCEPTS([{P1,{error,timeout}},{P2,{error,timeout}},
  			   {P3,{error,timeout}},{P4,{error,timeout}}], 2000).
  
  accept_timeouts_in_order2(suite) ->
      [];
  accept_timeouts_in_order2(doc) ->
      ["Check that multi-accept timeouts happen in the correct order (more)"];
  accept_timeouts_in_order2(Config) when is_list(Config) ->
      ?line {ok,LS}=gen_tcp:listen(0,[]),
      ?line Parent = self(),
      ?line P1 = spawn(mktmofun(1400,Parent,LS)),
      ?line P2 = spawn(mktmofun(1300,Parent,LS)),
      ?line P3 = spawn(mktmofun(1200,Parent,LS)),
      ?line P4 = spawn(mktmofun(1000,Parent,LS)),
      ?line ?EXPECT_ACCEPTS([{P4,{error,timeout}},{P3,{error,timeout}},
  			   {P2,{error,timeout}},{P1,{error,timeout}}], 2000).
  
  accept_timeouts_in_order3(suite) ->
      [];
  accept_timeouts_in_order3(doc) ->
      ["Check that multi-accept timeouts happen in the correct order (even more)"];
  accept_timeouts_in_order3(Config) when is_list(Config) ->
      ?line {ok,LS}=gen_tcp:listen(0,[]),
      ?line Parent = self(),
      ?line P1 = spawn(mktmofun(1200,Parent,LS)),
      ?line P2 = spawn(mktmofun(1400,Parent,LS)),
      ?line P3 = spawn(mktmofun(1300,Parent,LS)),
      ?line P4 = spawn(mktmofun(1000,Parent,LS)),
      ?line ?EXPECT_ACCEPTS([{P4,{error,timeout}},{P1,{error,timeout}},
  			   {P3,{error,timeout}},{P2,{error,timeout}}], 2000).
  
  accept_timeouts_mixed(suite) ->
      [];
  accept_timeouts_mixed(doc) ->
      ["Check that multi-accept timeouts behave correctly when mixed with successful timeouts"];
  accept_timeouts_mixed(Config) when is_list(Config) ->
      ?line {ok,LS}=gen_tcp:listen(0,[]),
      ?line Parent = self(),
      ?line {ok,PortNo}=inet:port(LS),
      ?line P1 = spawn(mktmofun(1000,Parent,LS)),
      ?line wait_until_accepting(P1,500),
      ?line P2 = spawn(mktmofun(2000,Parent,LS)),
      ?line wait_until_accepting(P2,500),
      ?line P3 = spawn(mktmofun(3000,Parent,LS)),
      ?line wait_until_accepting(P3,500),
      ?line P4 = spawn(mktmofun(4000,Parent,LS)),
      ?line wait_until_accepting(P4,500),
      ?line ok = ?EXPECT_ACCEPTS([{P1,{error,timeout}}],1500),
      ?line {ok,_}=gen_tcp:connect("localhost",PortNo,[]),
      ?line ok = ?EXPECT_ACCEPTS([{P2,{ok,Port0}}] when is_port(Port0),100),
      ?line ok = ?EXPECT_ACCEPTS([{P3,{error,timeout}}],2000),	
      ?line gen_tcp:connect("localhost",PortNo,[]),
      ?line ?EXPECT_ACCEPTS([{P4,{ok,Port1}}] when is_port(Port1),100).
  
  killing_acceptor(suite) ->
      [];
  
negative.code:     ?line {ok,L4} = prim_inet:getstatus(LS),
      ?line true  = lists:member(accepting, L4),
      ?line gen_tcp:connect("localhost",PortNo,[]),
      ?line ok = ?EXPECT_ACCEPTS([{Pid3,{ok,Port}}] when is_port(Port),1,100),
      ?line {ok,L5} = prim_inet:getstatus(LS),
      ?line false  = lists:member(accepting, L5),
      ok.
  