コード例 #1
0
 private Timer startPinger(PeerPingerState state)
 {
     // create and activate session pinger
     log("Creating and activating session pinger");
     return(new Timer(new TimerCallback(pingSession), // timer callback delegate
                      state,                          // user session object
                      0,                              // how long to wait before starting the timer
                      2000));                         // interval of time between pings (in milliseconds)
 }
コード例 #2
0
        private static void pingSession(object state)
        {
            PeerPingerState pingerState = (PeerPingerState)state;

            try
            {
                pingerState.getProxy().ice_ping();
            }
            catch (Exception e)
            {
                pingerState.pingFailed();
                pingerState.log("Exception while pinging: " + e);
            }
        }
コード例 #3
0
 private Timer startPinger(PeerPingerState state)
 {
     // create and activate session pinger
     log("Creating and activating session pinger");
     return new Timer(new TimerCallback(pingSession), // timer callback delegate
                      state, // user session object
                      0, // how long to wait before starting the timer
                      2000); // interval of time between pings (in milliseconds)
 }