wangzhengquan
2021-01-25 6c5289ee6886ffa78e5cc95a5b6947145d2001e1
update
1个文件已修改
7 ■■■■ 已修改文件
test_socket/bus_test.cpp 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_socket/bus_test.cpp
@@ -3,6 +3,9 @@
#include "shm_mm_wrapper.h"
#include "usg_common.h"
#include "mm.h"
#include "logger_factory.h"
static Logger *logger = LoggerFactory::getLogger();
BusServerSocket * server_socket;
void sigint_handler(int sig) {
@@ -24,9 +27,11 @@
  void *recvbuf;
  int size;
  int key;
  struct timespec timeout = {2, 0};
  ShmModSocket *sk = (ShmModSocket *)skptr;
  while ( true) {
    sk->recvfrom( &recvbuf, &size, &key);
    logger->debug("=========run_recv=====");
    sk->recvfrom_timeout( &recvbuf, &size, &key, &timeout);
    printf("收到订阅消息:%s\n", recvbuf);
    free(recvbuf);
  }