You have the following methods of the $wpdb
object:
$wpdb->check_connection()
that contains a call tomysqli_free_result()
ormysql_free_result()
if not supported.$wpdb->flush()
that contains a call tomysqli_ping()
ormysql_ping()
if not supported.
You can of course use all your PHP functions in WordPress.