| | |
| | | sprintf(portstr, "%d", port); |
| | | listenfd = open_listenfd(portstr); |
| | | if(listenfd < 0) { |
| | | LoggerFactory::getLogger()->error(errno, "NetModServerSocket::start . errno=%d", errno); |
| | | LoggerFactory::getLogger()->error(errno, "NetModServerSocket::start . errno=%d ", errno); |
| | | return -1; |
| | | } |
| | | init_pool(listenfd); |
| | |
| | | memcpy(head.action, "desub", sizeof(head.action)); |
| | | head.topic_size = topic_size = strlen(topic) + 1; |
| | | head.content_size = 0; |
| | | printf("sizeof(head.action) = %d\n", sizeof(head.action)); |
| | | void *buf; |
| | | int size = get_bus_sendbuf(head, topic, topic_size, NULL, 0, &buf); |
| | | if(size > 0) { |
| | |
| | | tmp_ptr += 4; |
| | | head.content_size = ntohl(GET(tmp_ptr)); |
| | | |
| | | printf("ShmModSocket::decode_bus_head action : %s\n", head.action); |
| | | return head; |
| | | } |
| | | |