| | |
| | | if (Signal(SIGPIPE, SIG_IGN) == SIG_ERR) |
| | | logger->error(errno, "NetModSocket::NetModSocket signal"); |
| | | |
| | | gpool = new NetConnPool(); |
| | | // gpool = new NetConnPool(); |
| | | |
| | | pthread_mutexattr_t mtxAttr; |
| | | s = pthread_mutexattr_init(&mtxAttr); |
| | | if (s != 0) |
| | | err_exit(s, "pthread_mutexattr_init"); |
| | | s = pthread_mutexattr_settype(&mtxAttr, PTHREAD_MUTEX_ERRORCHECK); |
| | | if (s != 0) |
| | | err_exit(s, "pthread_mutexattr_settype"); |
| | | s = pthread_mutex_init(&sendMutex, &mtxAttr); |
| | | if (s != 0) |
| | | err_exit(s, "pthread_mutex_init"); |
| | | // pthread_mutexattr_t mtxAttr; |
| | | // s = pthread_mutexattr_init(&mtxAttr); |
| | | // if (s != 0) |
| | | // err_exit(s, "pthread_mutexattr_init"); |
| | | // s = pthread_mutexattr_settype(&mtxAttr, PTHREAD_MUTEX_ERRORCHECK); |
| | | // if (s != 0) |
| | | // err_exit(s, "pthread_mutexattr_settype"); |
| | | // s = pthread_mutex_init(&sendMutex, &mtxAttr); |
| | | // if (s != 0) |
| | | // err_exit(s, "pthread_mutex_init"); |
| | | |
| | | s = pthread_mutexattr_destroy(&mtxAttr); |
| | | if (s != 0) |
| | | err_exit(s, "pthread_mutexattr_destroy"); |
| | | // s = pthread_mutexattr_destroy(&mtxAttr); |
| | | // if (s != 0) |
| | | // err_exit(s, "pthread_mutexattr_destroy"); |
| | | |
| | | } |
| | | |
| | | |
| | | NetModSocket::~NetModSocket() { |
| | | int s; |
| | | delete gpool; |
| | | s = pthread_mutex_destroy(&sendMutex); |
| | | // delete gpool; |
| | | // s = pthread_mutex_destroy(&sendMutex); |
| | | if(s != 0) { |
| | | err_exit(s, "shm_close_socket"); |
| | | } |