Example #1
0
        private void SecondTimer_Tick(object sender, EventArgs e)
        {
            if (XRay.Remote == null)
            {
                return;
            }

            ConnectionList.BeginUpdate();
            ConnectionList.Items.Clear();

            foreach (var client in XRay.Remote.SyncClients)
            {
                var conn = client.Connection;

                ConnectionList.Items.Add(string.Format("client: {0}, syncs: {1}({2}), in: {3}, out: {4} bps, sync size: {5}",
                                                       conn.RemoteIP, conn.SyncsPerSecond, client.TargetFps, conn.Bandwidth.InAvg(), conn.Bandwidth.OutAvg(), conn.LastSyncSize));
            }

            if (XRay.Remote.ServerConnection != null)
            {
                var server = XRay.Remote.ServerConnection;
                ConnectionList.Items.Add(string.Format("server: {0}, syncs: {1}, in: {2} bps, out: {3} bps, sync size: {4}",
                                                       server.RemoteIP, server.SyncsPerSecond, server.Bandwidth.InAvg(), server.Bandwidth.OutAvg(), server.LastSyncSize));
            }

            ConnectionList.EndUpdate();
        }