| | |
| | | if (mpool == NULL) |
| | | { |
| | | /* If first call from this thread, allocate buffer for thread, and save its location */ |
| | | logger->debug("Create connPool"); |
| | | mpool = new NetConnPool(); |
| | | if (mpool == NULL) { |
| | | LoggerFactory::getLogger()->error(errno, "NetModSocket::_sendandrecv_ malloc"); |
| | |
| | | |
| | | } |
| | | |
| | | void NetModSocket::buf_data_set(std::string str, int val) { |
| | | recvbuf.insert({str, val}); |
| | | } |
| | | |
| | | int NetModSocket::buf_data_get(std::string str) { |
| | | |
| | | int i; |
| | | int val = 0; |
| | | std::map<std::string, int>::iterator recvIter; |
| | | |
| | | recvIter = recvbuf.find(str); |
| | | if(recvIter != recvbuf.end()) { |
| | | |
| | | val = recvIter->second; |
| | | |
| | | } |
| | | |
| | | return val; |
| | | } |
| | | |
| | | void NetModSocket::buf_data_del(std::string str) { |
| | | recvbuf.erase(str); |
| | | } |
| | | |
| | | void NetModSocket::free_recv_msg_arr(net_mod_recv_msg_t * arr, size_t size) { |
| | | |