public ReturnCode startStatus ( ServerLock lock ) { // The server process might not have created the command file yet. // Wait for it to appear. while ( ! isValid ( ) ) { ReturnCode rc = startStatusWait ( lock ) ; if ( rc != ReturnCode . START_STATUS_ACTION ) { return rc ; } } for ( int i = 0 ; i < BootstrapConstants . MAX_POLL_ATTEMPTS && isValid ( ) ; i ++ ) { // Try to connect to the server's command file. This might fail if // the command file is written but the server hasn't opened the // socket yet. ReturnCode rc = write ( STATUS_START_COMMAND , ReturnCode . START_STATUS_ACTION , ReturnCode . ERROR_SERVER_START ) ; if ( rc != ReturnCode . START_STATUS_ACTION ) { return rc ; } // Wait a bit, ensuring that the server process is still running. rc = startStatusWait ( lock ) ; if ( rc != ReturnCode . START_STATUS_ACTION ) { return rc ; } } return write ( STATUS_START_COMMAND , ReturnCode . ERROR_SERVER_START , ReturnCode . ERROR_SERVER_START ) ; }
Waits for the server to be fully started .