| | |
| | | #include "shm_mm_wrapper.h" |
| | | #include "usg_common.h" |
| | | #include "mm.h" |
| | | #include "logger_factory.h" |
| | | #include "bus_error.h" |
| | | |
| | | static Logger *logger = LoggerFactory::getLogger(); |
| | | |
| | | BusServerSocket * server_socket; |
| | | void sigint_handler(int sig) { |
| | |
| | | |
| | | void *run_recv(void *skptr) { |
| | | while(true) { |
| | | printf("================run_recv\n"); |
| | | logger->debug("================run_recv\n"); |
| | | sleep(1); |
| | | } |
| | | } |
| | |
| | | ShmModSocket *sk = new ShmModSocket(); |
| | | |
| | | pthread_t tid; |
| | | pthread_create(&tid, NULL, run_recv, (void *)sk); |
| | | |
| | | int size; |
| | | |
| | | char action[512]; |
| | | char topic[512]; |
| | | char content[512]; |
| | | long i = 0; |
| | | |
| | | pthread_create(&tid, NULL, run_recv, (void *)sk); |
| | | |
| | | while (true) { |
| | | //printf("Usage: pub <topic> [content] or sub <topic>\n"); |
| | | printf("Can I help you? sub, pub, desub or quit\n"); |
| | | scanf("%s",action); |
| | | printf("Can I help you? sub, pub, desub or quit %d\n", i++); |
| | | // sleep(100); |
| | | scanf("%s", action); |
| | | |
| | | if(strcmp(action, "sub") == 0) { |
| | | printf("Please input topic!\n"); |