private void startRoundTripMeasurement() {
        if (scheduler != null) {
            if (pingInterval > 0) {
                if (log.isDebugEnabled()) {
                    log.debug("startRoundTripMeasurement - {}", sessionId);
                }
                try {
                    // schedule with an initial delay of now + 2s to prevent ping messages during connect post processes
                    keepAliveTask = scheduler.scheduleWithFixedDelay(new KeepAliveTask(), new Date(System.currentTimeMillis() + 2000L), pingInterval);
                    if (log.isDebugEnabled()) {
                        log.debug("Keep alive scheduled for {}", sessionId);
                    }
                } catch (Exception e) {
                    log.error("Error creating keep alive job for {}", sessionId, e);
                }
            }
        } else {
            log.error("startRoundTripMeasurement cannot be executed due to missing scheduler. This can happen if a connection drops before handshake is complete");
        }
    }
private void startRoundTripMeasurement ( ) { if ( scheduler != null ) { if ( pingInterval > 0 ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "startRoundTripMeasurement - {}" , sessionId ) ; } try { keepAliveTask = scheduler . scheduleWithFixedDelay ( new KeepAliveTask ( ) , new Date ( System . currentTimeMillis ( ) + 2000L ) , pingInterval ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Keep alive scheduled for {}" , sessionId ) ; } } catch ( Exception e ) { log . error ( "Error creating keep alive job for {}" , sessionId , e ) ; } } } else { log . error ( "startRoundTripMeasurement cannot be executed due to missing scheduler. This can happen if a connection drops before handshake is complete" ) ; } }
Starts measurement.