| | |
| | | if(ret == 0 ) { |
| | | n_pub_suc++; |
| | | } |
| | | return n_pub_suc; |
| | | } |
| | | |
| | | for (i = 0; i < arrlen; i++) { |
| | |
| | | } |
| | | request_head.mod = BUS; |
| | | memcpy(request_head.host, node->host, sizeof(request_head.host)); |
| | | request_head.key = node->key; |
| | | request_head.key = SHM_BUS_KEY; |
| | | request_head.content_length = content_size; |
| | | request_head.topic_length = strlen(topic) + 1; |
| | | request_head.timeout = msec; |
| | |
| | | * @return 0 成功, 其他值 失败的错误码 |
| | | */ |
| | | int NetModSocket::recvfrom(void **buf, int *size, int *key) { |
| | | |
| | | logger->debug(" %d NetModSocket::recvfrom before", get_key()); |
| | | int rv = shmModSocket.recvfrom(buf, size, key); |
| | | |
| | | if(rv == 0) { |
| | | logger->debug("NetModSocket::recvfrom: %d recvfrom %d success.\n", get_key(), *key); |
| | | logger->debug("NetModSocket::recvfrom: <<<< %d recvfrom %d success.\n", get_key(), *key); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | struct timespec timeout = {sec, nsec}; |
| | | int rv = shmModSocket.recvfrom_timeout(buf, size, key, &timeout); |
| | | if(rv == 0) { |
| | | logger->debug("NetModSocket::recvfrom: %d recvfrom %d success.\n", get_key(), *key); |
| | | logger->debug("NetModSocket::recvfrom_timeout: %d recvfrom %d success.\n", get_key(), *key); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | int NetModSocket::recvfrom_nowait(void **buf, int *size, int *key){ |
| | | int rv = shmModSocket.recvfrom_nowait(buf, size, key); |
| | | if(rv == 0) { |
| | | logger->debug("NetModSocket::recvfrom: %d recvfrom %d success.\n", get_key(), *key); |
| | | logger->debug("NetModSocket::recvfrom_nowait: %d recvfrom %d success.\n", get_key(), *key); |
| | | return 0; |
| | | } |
| | | |