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) }
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); } }
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) }