MySQL :: MySQL 8.4 C API Developer Guide :: 7.4.5 mysql_real_connect_nonblocking() (original) (raw)
7.4.5 mysql_real_connect_nonblocking()
enum net_async_status
mysql_real_connect_nonblocking(MYSQL *mysql,
const char *host,
const char *user,
const char *passwd,
const char *db,
unsigned int port,
const char *unix_socket,
unsigned long
client_flag)
Description
Note
mysql_real_connect_nonblocking() is an asynchronous function. It is the counterpart of themysql_real_connect() synchronous function, for use by applications that require asynchronous communication with the server. For general information about writing asynchronous C API applications, see Chapter 7, C API Asynchronous Interface.
mysql_real_connect_nonblocking() is used similarly tomysql_real_connect(). For details about the latter, seeSection 5.4.58, “mysql_real_connect()”. The two functions differ as follows:
- mysql_real_connect() returns a connection handler or
NULL
. - mysql_real_connect_nonblocking() returns an
enum net_async_status
status indicator.
mysql_real_connect_nonblocking() was added in MySQL 8.0.16.
Return Values
Returns an enum net_async_status
value. See the description inSection 7.2, “C API Asynchronous Interface Data Structures”. ANET_ASYNC_ERROR
return status indicates an error.