anchor.diff:      diameter_peer:up(Pid),
       S#transport{mode = A}.
   
  -%% find/3
  -
  -find(Id, Data, #listener{tmap = T} = S) ->
  -    f(ets:lookup(T, Id), Data, S).
  -
  -%% New association ...
  -f([],
  -  {_, #sctp_assoc_change{state = comm_up, assoc_id = Id}},
  -  #listener{pending = {N,Q}}
  -  = S) ->
  -    {find(Id, S), S#listener{pending = {N+1,Q}}};
  -
  -%% Known association ...
  -f([{_, TPid}], _, S) ->
  -    {TPid, S};
  -
  -%% ... or not: discard.
  -f([], _, _) ->
  -    false.
  -
  -%% find/2
  +%% 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.
  -find(Id, #listener{tmap = T,
  -                   pending = {N,Q}})
  +tpid(_Id, #listener{pending = {N,Q}})
     when N < 0 ->
  -    TPid = ets:first(Q),
  -    [{TPid, MRef}] = ets:lookup(T, TPid),
  -    ets:insert(T, [{MRef, Id}, {Id, TPid}]),
  -    ets:delete(T, TPid),
  -    ets:delete(Q, TPid),
  -    TPid;
  +    dq(Q);
   
   %% No transport start yet: spawn one and queue.
  -find(Id, #listener{ref = Ref,
  +tpid(Id, #listener{ref = Ref,
                      socket = Sock,
  -                   tmap = T,
                      pending = {_,Q}}) ->
  -    Arg = {accept, Ref, self(), Sock, Id},
  +    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),
  -    MRef = monitor(process, TPid),
  -    ets:insert(T, [{MRef, Id}, {Id, TPid}]),
  +    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;
  
positive.code:                       socket = LSock}
             = S) ->
      ok = accept_peer(Sock, Matches),
      transition(Msg, S#transport{socket = Sock});
  
  %% Incoming message.
  transition({sctp, _Sock, _RA, _RP, Data}, #transport{socket = Sock} = S) ->
      setopts(Sock),
      recv(Data, S);
  %% Don't match on Sock since in R15B01 it can be the listening socket
  %% in the (peeled-off) accept case, which is likely a bug.
  
  %% Outgoing message.
  transition({diameter, {send, Msg}}, S) ->
  
negative.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}),
  