Aquiring the socket file descriptor from ODBC C API

Solution for Aquiring the socket file descriptor from ODBC C API
is Given Below:

I’m working with a framework that detects DB activity through the file descriptor of the DB client. In MySQL and PostgreSQL, the function mysql_get_socket and PQsocket returns the socket file descriptor of a connection. I’m looking for something like the following:

int fd = SQLGetSocketFd(hcon); // The function that returns the fd
// now the fd is passed to epoll/kqueue so I'm notified when a read or write happens to this socket.
add_to_event_pool(fd);

I’ve searched Microsoft’s documents and unixODBC’s source code but can’t find one. Is there an equivalent in ODBC?