TSystems.RELOAD.ForwardAndLinkManagement.CandidatePair.CandidatePair C# (CSharp) Method

CandidatePair() public method

public CandidatePair ( IceCandidate localCandidate, IceCandidate remoteCandidate ) : STUN
localCandidate TSystems.RELOAD.Topology.IceCandidate
remoteCandidate TSystems.RELOAD.Topology.IceCandidate
return STUN
        public CandidatePair(IceCandidate localCandidate, IceCandidate remoteCandidate)
        {
            this.localCandidate = localCandidate;
            this.remoteCandidate = remoteCandidate;

            this.valid = false;
            this.nominated = false;
            this.state = CandidatePairState.Frozen;

            this.pairPriority = 0;

            /* RFC 5245, ICE, Section 5.7.4
            Each candidate pair in the check list has a foundation and a state.
            The foundation is the combination of the foundations of the local and
            remote candidates in the pair.
            */
            if (localCandidate.foundation != null && remoteCandidate.foundation != null)
            {
                this.pairFoundation = new byte[localCandidate.foundation.Length + remoteCandidate.foundation.Length];
                // first copy local candidate foundation
                Array.Copy(localCandidate.foundation, 0, this.pairFoundation, 0, localCandidate.foundation.Length);
                // then copy remote candidate foundation
                Array.Copy(remoteCandidate.foundation, 0, this.pairFoundation, localCandidate.foundation.Length, remoteCandidate.foundation.Length);
            }
            else
                this.pairFoundation = null;
        }