methodTsmStreamSecII.Tls13PeekServerTicket
function Tls13PeekServerTicket(const aIdentity: TBytes): TTls13ServerTicket;
Single-use resumption support. Tls13PeekServerTicket returns a detached CLONE (caller owns + frees) of the stored ticket for aIdentity, or nil - so the handshake can verify the binder off a private copy without holding the store lock across the crypto. The handshake claims ONLY after the binder verifies, so a cleartext ticket identity cannot be used to burn a ticket.
Tls13ConsumeServerTicket IS THE ATOMIC CLAIM, AND ITS RESULT IS THE WHOLE OF SINGLE-USE. True means THIS caller removed the ticket and may resume; False means it was already gone - expired, reaped, or claimed by a concurrent handshake that peeked the same identity first - and the caller MUST NOT resume on it. A CALLER THAT IGNORES THE RESULT DEFEATS THE MECHANISM. Peek and claim take the store lock separately, so between them two connections can both hold a valid clone and both verify the binder; what makes exactly one of them the owner is which one's claim returns True, not which one verified. The async TLS server drives handshakes with no shard lock (UseDirectLayer) and picks shards round-robin, so two handshakes on one store is an arrangeable condition, not a rare one. This is also the primitive a shared or distributed ticket store has to provide - an atomic test-and-set, e.g. Redis GETDEL - which is why it is shaped as a question rather than a command.