Esempio n. 1
0
        private async void UpdateSpeed(object sender, EventArgs e)
        {
            InOutBytes total;

            using (await _lock.Lock())
            {
                try
                {
                    total = await _vpnServiceManager.Total();
                }
                catch (CommunicationException)
                {
                    return;
                }
                catch (TimeoutException)
                {
                    return;
                }
            }

            _speed = total - _total;
            _total = total;
        }
Esempio n. 2
0
 private static InOutBytesContract Map(InOutBytes bytes)
 {
     return(new InOutBytesContract(bytes.BytesIn, bytes.BytesOut));
 }
Esempio n. 3
0
 private void OnTransportStatsChanged(InOutBytes bandwidth)
 {
     TransportStatsChanged?.Invoke(this, new EventArgs <InOutBytes>(bandwidth));
 }
Esempio n. 4
0
 private void ManagementClient_TransportStatsChanged(object sender, EventArgs <InOutBytes> e)
 {
     Total = e.Data;
 }
Esempio n. 5
0
        private void HandleByteMessage(ReceivedManagementMessage message)
        {
            InOutBytes bandwidth = message.Bandwidth();

            OnTransportStatsChanged(bandwidth);
        }
Esempio n. 6
0
 private void OnTrafficSent(object sender, InOutBytes total)
 {
     Total = total;
 }