Brunet.Security.Dtls.DtlsAssociation.Handshake C# (CSharp) Метод

Handshake() публичный Метод

Start the session earlier than waiting for a packet to be sent. Not doing this may increase the amount of lost packets.
public Handshake ( ) : void
Результат void
    public void Handshake()
    {
      HandleWouldBlock();
    }

Usage Example

Пример #1
0
        override public SecurityAssociation CreateSecurityAssociation(ISender sender)
        {
            DtlsAssociation sa = null;

            if (_sender_to_sa.TryGetValue(sender, out sa))
            {
                return(sa);
            }

            if (NoSuchSA(sender, 0, true, out sa))
            {
                DtlsAssociation tmpsa = sa;
                bool            close = false;
                lock (_sender_to_sa) {
                    if (_sender_to_sa.TryGetValue(sender, out sa))
                    {
                        close = true;
                    }
                    else
                    {
                        _sender_to_sa.Add(sender, tmpsa);
                    }
                }

                if (close)
                {
                    tmpsa.Close("Duplicate");
                }
                else
                {
                    sa = tmpsa;
                    _it.Add(sa);
                    sa.Subscribe(this, null);
                    sa.Handshake();
                }
            }

            return(sa);
        }