This project is read-only.
1
Vote

http listener doesn't answer on vm machine

description

Hi All,

I'm testing http_listener_test.cpp example, building on VS 2013 and using c++ rest v2.4.
My problem happens only on vmware machine where running the same demo application
I got no response from listener.
I don't unserstand why, the same application works fine on a real machine.

Any suggestion?
Thank you
Andrea

comments

gibshy wrote Nov 30, 2016 at 2:47 PM

Have you found anyway to fix it?

I have encountered the same problems.

AndreaVix wrote Nov 30, 2016 at 3:26 PM

Not really, I don't understand why but in this way the listener now it works:
    listener.support(methods::GET, handle_get);
    listener.support(methods::POST, handle_post);
    listener.support(methods::PUT, handle_put);
    listener.support(methods::DEL, handle_del);


    try
    {
        listener
            .open()
            .then([&listener](){
                DEBUG(DBG_DEBUG, "Started listener ");  


            })
            .wait();
            while (true) {
                DEBUG(DBG_DEBUG, "Sleeping");
                //wait an hour and verify log switch
                Sleep(3600000);
                DEBUG_CONF("outputfile", Logger::file_on, DBG_DEBUG, DBG_ERROR);
            };

    }
    catch (exception const & e)
    {
        DEBUG(DBG_ERROR, e.what());
    }
Good luck
Andrea

gibshy wrote Dec 5, 2016 at 8:18 AM

Thanks Andrea.

My problems turned out. it was related with some pplx::tasks as work thread.

here is my article.

https://casablanca.codeplex.com/discussions/659912