wangzhengquan
2020-08-06 203df24a403a8c0cd8e93d0f33eaf10de2788969
test_socket/dgram_mod_bus.c
@@ -49,7 +49,7 @@
  long i = 0;
  while (true) {
    //printf("Usage: pub <topic> [content] or sub <topic>\n");
    printf("Can I help you? sub, pub or quit\n");
    printf("Can I help you? sub, pub, desub or quit\n");
    scanf("%s",action);
    
    if(strcmp(action, "sub") == 0) {
@@ -59,6 +59,16 @@
         printf("Sub success!\n");
      } else {
        printf("Sub failture!\n");
        exit(0);
      }
    } else if(strcmp(action, "desub") == 0) {
      printf("Please input topic!\n");
      scanf("%s", topic);
      if (dgram_mod_desub(socket, topic, strlen(topic),  port) == 0) {
         printf("Desub success!\n");
      } else {
        printf("Desub failture!\n");
        exit(0);
      }
     
@@ -76,7 +86,7 @@
    } else if(strcmp(action, "quit") == 0) {
      break;
    } else {
      printf("error input\n");
      printf("error input argument\n");
      continue;
    }