wangzhengquan
2020-08-03 b63ce299ddacea2ad487dc635926ed52ff422c20
test_socket/dgram_mod_bus.c
@@ -55,15 +55,24 @@
    if(strcmp(action, "sub") == 0) {
      printf("Please input topic!\n");
      scanf("%s", topic);
      dgram_mod_sub(socket, topic, strlen(topic),  port);
      if (dgram_mod_sub(socket, topic, strlen(topic),  port) == 0) {
      printf("Sub success!\n");
      } else {
        printf("Sub failture!\n");
        exit(0);
      }
    }
    else if(strcmp(action, "pub") == 0) {
      // printf("%s %s %s\n", action, topic, content);
      printf("Please input topic and content\n");
      scanf("%s %s", topic, content);
      dgram_mod_pub(socket, topic, strlen(topic)+1, content, strlen(content)+1,  port);
      if(dgram_mod_pub(socket, topic, strlen(topic)+1, content, strlen(content)+1,  port) == 0){
      printf("Pub success!\n");
      } else {
        printf("Pub failture!\n");
      }
    } else if(strcmp(action, "quit") == 0) {
      break;
    } else {