anchor.diff:    end.
   
   accept_callouts(S, [_Socket, Id]) ->
  -  case [ Sock || Sock <- S#state.sockets,
  -                 Sock#socket.parent == Id,
  -                 lists:member(Sock#socket.tcp_state, [established, close_wait]),
  -                 Sock#socket.socket == undefined ] of
  -    [Sock | _] ->
  -      NewId = Sock#socket.id,
  +  Sock = get_socket(S, Id),
  +  case Sock#socket.accept_queue of
  +    [NewId | _] ->
  +      ?UPD(Id, accept_queue, [_ | Q], Q),
         ?APPLY(set_socket, [NewId]);
       [] ->
  -      Sock = get_socket(S, Id),
         ?SET(Id, blocked, Sock#socket.blocked ++ [?SELF]),
         ?MATCH(NewId, ?BLOCK({accept, ?SELF})),
         ?WHEN(NewId /= closed, ?APPLY(set_socket, [NewId]))
  
positive.code:   Sock = get_socket(S, Id),
    ?PAR([ ?UNBLOCK({close, Pid}, ok) || Pid <- Sock#socket.blocked ]).
  
  
  set_next(S, _, [Id, Key, Value]) ->
    Sock = get_socket(S, Id),
  
negative.code:         #socket{blocked = [Pid | Pids]} ->
            ?UNBLOCK({accept, Pid}, Id),
            ?SET(P, blocked, Pids);
          false -> ?EMPTY;
          _     -> ?UPD(P, accept_queue, Q, Q ++ [Id])
        end;
      fin_wait_1 ->
        ?SET(Id, tcp_state, fin_wait_2);
  