private void startConnecting ( ) { // Open the connecting socket. try { boolean rc = open ( ) ; // Connect may succeed in synchronous manner. if ( rc ) { handle = ioObject . addFd ( fd ) ; connectEvent ( ) ; } // Connection establishment may be delayed. Poll for its completion. else { handle = ioObject . addFd ( fd ) ; ioObject . setPollConnect ( handle ) ; socket . eventConnectDelayed ( addr . toString ( ) , - 1 ) ; } } catch ( RuntimeException | IOException e ) { // Handle any other error condition by eventual reconnect. if ( fd != null ) { close ( ) ; } addReconnectTimer ( ) ; } }
Internal function to start the actual connection establishment .