Пример #1
0
            public void Proc()
            {
                _Net.Proc();

                if (_PeriodUnLinked.CheckAndNextLoose())
                {
                    var Now = DateTime.Now;

                    for (var it = _PeersExt.Begin(); it;)
                    {
                        var itCheck = it;
                        it.MoveNext();

                        if (itCheck.Data.DoesWillClose() && itCheck.Data.CloseTime < Now)
                        {
                            _Close(itCheck);
                        }
                    }

                    for (var it = _PeersWillExpire.Begin(); it;)
                    {
                        var itCheck = it;
                        it.MoveNext();

                        if (itCheck.Data.ExpireTime > Now)
                        {
                            break;
                        }

                        _UnLink(itCheck.Data.PeerExtNum, ENetRet.KeepConnectTimeOut);
                        _PeersWillExpire.Remove(itCheck);
                    }

                    foreach (var it in _PeersWillExpire)
                    {
                        if (!it.NeedToConnect)
                        {
                            continue;
                        }

                        var itPeerExt = _PeersExt.Get((Int32)it.PeerExtNum);
                        if (!itPeerExt)
                        {
                            continue;
                        }

                        _Connect(itPeerExt);
                    }
                }
            }
Пример #2
0
 public void Proc()
 {
     _NetA.Proc();
     _NetM.Proc();
     _NetS.Proc();
 }
Пример #3
0
 //public void Send<_TProtoType>(_TProtoType Proto_) where _TProtoType : IProto
 //{
 //    _Net.Send(_ServerKey, Proto_);
 //}
 //public void Send<_TProtoType0, _TProtoType1>(_TProtoType0 Proto0_, _TProtoType1 Proto1_)
 //    where _TProtoType0 : IProto
 //    where _TProtoType1 : IProto
 //{
 //    _Net.Send(_ServerKey, Proto0_, Proto1_);
 //}
 //public void Send<_TProtoType0, _TProtoType1, _TProtoType2>(_TProtoType0 Proto0_, _TProtoType1 Proto1_, _TProtoType2 Proto2_)
 //    where _TProtoType0 : IProto
 //    where _TProtoType1 : IProto
 //    where _TProtoType2 : IProto
 //{
 //    _Net.Send(_ServerKey, Proto0_, Proto1_, Proto2_);
 //}
 public void Proc()
 {
     _Net.Proc();
 }