private void addReconnectTimer ( ) { int rcIvl = getNewReconnectIvl ( ) ; ioObject . addTimer ( rcIvl , RECONNECT_TIMER_ID ) ; // resolve address again to take into account other addresses // besides the failing one (e.g. multiple dns entries). try { addr . resolve ( options . ipv6 ) ; } catch ( Exception ignored ) { // This will fail if the network goes away and the // address cannot be resolved for some reason. Try // not to fail as the event loop will quit } socket . eventConnectRetried ( addr . toString ( ) , rcIvl ) ; timerStarted = true ; }
Internal function to add a reconnect timer