private bool TryDecodeTransactionKId(ByteArrayPart branch, out int transactionKId)
        {
            int begin = branch.Begin + SipMessage.MagicCookie.Length;
            int end   = branch.End;

            if (begin + 8 == end && HexEncoding.TryParseHex8(branch.Bytes, begin, out transactionKId) &&
                Transaction.IsValidTransactionId(transactionKId))
            {
                transactionKId = Transaction.GetTransactionKId(trasactionKind, transactionKId);
                return(true);
            }

            transactionKId = 0;
            return(false);
        }
 public int GetTransactionId()
 {
     return(Transaction.GetTransactionKId(trasactionKind, Interlocked.Increment(ref transactionCount)));
 }
Пример #3
0
 private int GenerateKId()
 {
     return(Transaction.GetTransactionKId(trasactionKind, ++transactionCount));
 }