Exemplo n.º 1
0
    public void OnApplicationPause(bool willPause)
    {
        if (willPause)
        {
            lock (threadClientLock)
            {
                threadClient = this.GameInstance;
            }
            thread = new Thread(this.SendAcks);
            thread.IsBackground = true;
            thread.Start();
        }
        else
        {
            lock (threadClientLock)
            {
                threadClient = null;
            }
        }


        LoadBalancingPeer lbPeer = this.GameInstance.loadBalancingPeer;

        Debug.Log("OnApplicationPause " + (willPause ? "SLEEP":"WAKE") + " time: " + DateTime.Now.ToLongTimeString() + " " + lbPeer.BytesIn + "in " + lbPeer.BytesOut + "out");


        if (!willPause)
        {
            lbPeer.Service();
            int timeSinceLastReceive = Environment.TickCount - lbPeer.TimestampOfLastSocketReceive;
            Debug.Log("IsConnectedAndReady: " + this.GameInstance.IsConnectedAndReady + " timeSinceLastReceive: " + timeSinceLastReceive);
        }
    }
Exemplo n.º 2
0
 public void Service()
 {
     _loadBalancingPeer.Service();
 }