List:MySQL++« Previous MessageNext Message »
From:Distributed Hackers Date:April 26 2007 2:20am
Subject:problem with mysql_real_connect and mysql_close
View as plain text  
mysql_real_connect open a socket connection to the database.
But who closes this connection and when
Is this done by mysql_close() or do I have to explicitly close the

    171     if(!mysql_real_connect(conn, server, username, password,
database, 0, NULL, 0))
    172     {
    173         mysql_close(conn);
    174         free(*server_addr);
    175         printf("%s: Error in connection!!....1\n", __func__);
    176         printf("%s: %s\n", __func__, mysql_error(conn));
    177         return ERROR;
    178     }

   263     mysql_close(conn);
The error i get is cannot create UNIX socket. The application runs for
sometime and when I check the proc file system, I see 1024 fd's.

Please let me know if i need to do something in addition to the above.


problem with mysql_real_connect and mysql_closeDistributed Hackers26 Apr
  • Re: problem with mysql_real_connect and mysql_closeWarren Young26 Apr