} else {
$mysqli->options( MYSQLI_SET_CHARSET_NAME, 'binary' );
}
+ $mysqli->options( MYSQLI_OPT_CONNECT_TIMEOUT, 3 );
- $numAttempts = 2;
- for ( $i = 0; $i < $numAttempts; $i++ ) {
- if ( $i > 1 ) {
- usleep( 1000 );
- }
- if ( $mysqli->real_connect( $realServer, $this->mUser,
- $this->mPassword, $this->mDBname, $port, null, $connFlags )
- ) {
- return $mysqli;
- }
+ if ( $mysqli->real_connect( $realServer, $this->mUser,
+ $this->mPassword, $this->mDBname, $port, null, $connFlags )
+ ) {
+ return $mysqli;
}
return false;