Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Listener silently fails to open on Ubuntu Linux 14.04

$
0
0
I'm trying to create a restful listener. I compiled everything from source with cmake and gcc 4.8.2.
I've tried launching the blackjack server demo, it launches correctly but if I nmap localhost, I don't see a new open port.

I've also tried starting my own listener as follows:
// **************************************************************************************
int main()
{
web::http::experimental::listener::http_listener listener(web::uri("http://127.0.0.1/restdemo"));


listener.support(web::http::method("GET"), handle_get);
listener.support(web::http::method("PUT"), handle_put);
listener.support(web::http::method("POST"), handle_post);
listener.support(web::http::method("DEL"), handle_delete);
try
{
    listener.open().then([](){std::cout << "Listener Started" << std::endl;}).wait();
}catch(std::exception &e)
{
    std::cout << e.what() << std::endl;
}

while(1)
{
    boost::this_thread::sleep_for(boost::chrono::milliseconds(30));
}
listener.close();
return 0;
}

// *******************************************************************
This successfully enters the while loop, and "Listener Started" is print to console, but there are no open ports.

I've tried running this as a normal user and as root.
I've tried entering my IP address, "localhost", and "127.0.0.1" as the URI.

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>