int clientfd= socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if(clientfd < 0){
syslog(LOG_LOCAL0|LOG_ERR,"can not create BroadcastMessage socket");
return;
}
ON_BLOCK_EXIT(close, clientfd);
MYSQL *mysql = getConnectDb();
if (mysql == NULL){
syslog(LOG_LOCAL0|LOG_ERR,"can not connect mysql database /n");
return ;
}
ON_BLOCK_EXIT(putConnectDb, mysql);
if(clientfd < 0){
syslog(LOG_LOCAL0|LOG_ERR,"can not create BroadcastMessage socket");
return;
}
ON_BLOCK_EXIT(close, clientfd);
MYSQL *mysql = getConnectDb();
if (mysql == NULL){
syslog(LOG_LOCAL0|LOG_ERR,"can not connect mysql database /n");
return ;
}
ON_BLOCK_EXIT(putConnectDb, mysql);