wangzhengquan
2020-09-25 00dba6082e245d917cb7d6eed3c627211ff41cd7
update
2个文件已修改
8 ■■■■ 已修改文件
test_socket/Makefile 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_socket/dgram_mod_survey.c 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_socket/Makefile
@@ -2,7 +2,7 @@
# Makefile for common library.
#
ROOT=..
LDLIBS+=-Wl,-rpath=$(ROOT)/lib:$(ROOT)/build/lib
# LDLIBS+=-Wl,-rpath=$(ROOT)/lib:$(ROOT)/build/lib
# 开源工具包路径
LDDIR += -L$(ROOT)/build/lib
# 开源工具包
test_socket/dgram_mod_survey.c
@@ -25,7 +25,7 @@
  int rv;
  int remote_port;
  while (true) {
    if ((rv = dgram_mod_recvfrom_timeout(socket, &recvbuf, &size, &remote_port, 5, 0) ) == 0) {
    if ((rv = dgram_mod_recvfrom_timeout(socket, &recvbuf, &size, &remote_port, 15, 0) ) == 0) {
      printf( "RECEIVED HREARTBEAT FROM %d: %s\n", remote_port, recvbuf);
      free(recvbuf);
    }
@@ -43,7 +43,7 @@
    sprintf(sendbuf, "%d", i);
    printf("SEND HEART:%s\n", sendbuf);
    dgram_mod_sendto(socket, sendbuf, strlen(sendbuf) + 1, port);
    sleep(1);
   // sleep(1);
    i++;
  }
  dgram_mod_close_socket(socket);
@@ -124,4 +124,4 @@
  shm_destroy();
  return 0;
}
}