Exemple #1
0
        public override void Update()
        {
            Connection.Update();
            if (Connection.State == ConnectionState.Error)
            {
                Disconnect(Connection.Error);
            }

            TokenManager.Update();
            TokenCache.Update();
        }
Exemple #2
0
        public override void Update()
        {
            for (var i = 0; i < Connections.Count; i++)
            {
                Connections[i].Update();

                if (Connections[i].State == ConnectionState.Error)
                {
                    if (Time.Get() - Connections[i].ConnectedAt < Time.Freq())
                    {
                        NetworkBan.BanAddr(Connections[i].EndPoint, 60, "Stressing network");
                    }
                    else
                    {
                        Drop(i, Connections[i].Error);
                    }
                }
            }

            TokenManager.Update();
            TokenCache.Update();
        }