anchor.diff:          {ref       :: reference(),
            socket    :: gen_sctp:sctp_socket(),
            count = 0 :: uint(),  %% attached transport processes
  -         tmap = ets:new(?MODULE, []) :: ets:tid(),
  -             %% {MRef, Pid|AssocId}, {AssocId, Pid}
            pending = {0, ets:new(?MODULE, [ordered_set])},
            tref      :: reference(),
            accept    :: [match()]}).
  -%% Field tmap is used to map an incoming message or event to the
  -%% relevant transport process. Field pending implements two queues:
  -%% the first of transport-to-be processes to which an association has
  -%% been assigned (at comm_up and written into tmap) but for which
  +%% Field pending implements two queues: the first of transport-to-be
  +%% processes to which an association has been assigned but for which
   %% diameter hasn't yet spawned a transport process, a short-lived
   %% state of affairs as a new transport is spawned as a consequence of
   %% a peer being taken up, transport processes being spawned by the
  
positive.code: l([{{?MODULE, listener, {_, AS}}, LPid}], _, _) ->
       {LAs, _Sock} = AS,
       {LPid, LAs};
   
  %% ... or not.
  l([], LRef, T) ->
      {ok, LPid, LAs} = diameter_sctp_sup:start_child({listen, LRef, T}),
  
negative.code:     diameter_peer:up(Pid),
      S#transport{mode = A}.
  
  %% accept/2
  %%
  %% Start a new transport process or use one that's already been
  %% started as a consequence of an event to a listener process.
  
  accept(Id, #listener{pending = {N,Q}} = S) ->
      {tpid(Id, S), S#listener{pending = {N+1,Q}}}.
  
  %% tpid/2
  
  %% Transport waiting for an association: use it.
  tpid(_Id, #listener{pending = {N,Q}})
    when N < 0 ->
      dq(Q);
  
  %% No transport start yet: spawn one and queue.
  tpid(Id, #listener{ref = Ref,
                     socket = Sock,
                     pending = {_,Q}}) ->
      nq({accept, Ref, self(), Sock, Id}, Q).
  
  %% nq/2
  %%
  %% Place a transport process in the second pending queue to make it
  %% available to the next association.
  
  nq(Arg, Q) ->
      {ok, TPid} = diameter_sctp_sup:start_child(Arg),
      monitor(process, TPid),
      ets:insert(Q, {TPid, now()}),
      TPid.
  
  %% dq/1
  %%
  %% Remove a transport process from the first pending queue to assign
  %% it to an existing association.
  
  dq(Q) ->
      TPid = ets:first(Q),
      ets:delete(Q, TPid),
      TPid.
  
  %% assoc_id/1
  %%
  %% It's unclear if this is needed, or if the first message on an
  %% association is always sctp_assoc_change, but don't assume since
  %% SCTP behaviour differs between operating systems.
  
  assoc_id({[#sctp_sndrcvinfo{assoc_id = Id}], _}) ->
      Id;
  