diff options
Diffstat (limited to 'agni.c')
-rw-r--r-- | agni.c | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -664,7 +664,7 @@ int th_event_manager(void *data) int err; int mq_event; //read any command - //mq_cmd *cmd = NULL; + mq_cmd *recv_cmd = NULL; // for recieved cmd from mq struct mq_attr out_attr, *ptr_out_attr=&out_attr; printf("Start event thread\n"); @@ -714,12 +714,35 @@ int th_event_manager(void *data) //if (run == 10) // break; - //applay to recieved command executor //if QUIT then quit the thread + recv_cmd = mq_cmd_creates(out_buf, out_attr.mq_msgsize, -1); + if (recv_cmd != NULL) + { + PNL(); + if (mq_cmd_o_cmp_cmd(recv_cmd,"QUIT") == 0) + { + printf("QUIT recieved lets quit main loop\n"); + break; + } + + if (mq_cmd_o_cmp_cmd(recv_cmd,"CMD1") == 0) + { + printf("Hey dude it works\n"); + } + + if (mq_cmd_o_cmp_cmd(recv_cmd,"CMD2") == 0) + { + printf("Hey dude it works second time\n"); + } + + } + + //applay to recieved command executor + //other command pass to cmd/execution matching table //pass to exec handler //get response if command is immidieate otherwise wait for response in next execution - + } free(out_buf); |