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

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