0
  listener.support(methods::POST, handle_post);

In handle_post function:

void handle_post(http_request request)
{
    //process the request I receives,extract the value in the request
 }

Now I need the function handle_post to pass the msg it receives. For example, my project sends msg to the second project(which is not implemented by me) on port num 8000 as a client. port 8000 is listened by the second project. After the second project receives my msg, it will send his answer to my project on another port num like 9000 which is listened by my project. Now I need to process the answers(by the function handle_post) comes from the second project and send the value extract from the answer to the the main function which is running send_msg_to_second_project function so that the function can keep going on. Kind like:

In my project:

main Function()
{
 send_msg_to_second_project();
 wait until I got the value in the answer from the second project on another port num 9000 which is listened by me;
 keep sending more msg to second project;
}

But How could I pass a msg by handle_post ?

firstaccount
  • 155
  • 2
  • 13

0 Answers0