mysql\_get\_socket(3) MariaDB Connector/C mysql\_get\_socket(3)

## [Name](#Name)

mysql\_get\_socket - Returns the descriptor of the socket used for the current connection

## [Synopsis](#Synopsis)

```
#include <mysql.h>
my_socket mysql_get_socket(MYSQL * mysql);
    
```

## [Description](#Description)

Returns the descriptor of the socket used for the current connection.

## [Parameter](#Parameter)

•

mysql - a mysql handle, which was previously allocated by [**mysql\_init(3)**](/man/os/mariadb-11.6/mysql_init.3) and connected by [**mysql\_real\_connect(3)**](/man/os/mariadb-11.6/mysql_real_connect.3).

## [Return value](#Return_value)

A socket handle or INVALID\_SOCKET (-1) if the socket descriptor could not be determined, e.g. if the connection doesn’t use a socket connection.

## [See also](#See_also)

•

[**mysql\_real\_connect(3)**](/man/os/mariadb-11.6/mysql_real_connect.3)

Version 3.4

---

Document: mysql_get_socket(3) from mariadb-11.6 11.6.2-r0 (Chainguard OS)
