emscripten-ports / asio

8 stars 0 forks source link

Exception when calling asio::ip::tcp::socket socket(asio::io_service); #1

Open tikotus opened 8 years ago

tikotus commented 8 years ago

I'm trying to use the asio port to make http requests. I'm building with -D ASIO_STANDALONE and -D ASIO_HEADER_ONLY (the latter is redundant I think, but just to be sure). Here is a code snippet I'm running

asio::io_service io_service;
asio::ip::tcp::resolver resolver(io_service);
asio::ip::address addr = asio::ip::address::from_string("127.0.0.1");
asio::ip::tcp::endpoint endpoint(addr, 80);
asio::ip::tcp::socket socket(io_service);
// some more code to make the actual request, which is irrelevant at the moment

This works on OS X but in browser I get an exception that can't be caught from the call to socket constructor. I tried to track down where the exception comes from. It seems to come from somewhere inside the call to factory(owner) on line 131 in service_registry.ipp with reactive_socket_service_base constructor in the callstack.

Any ideas what is wrong? Should this work and is someone else able to run it?

cynecx commented 8 years ago

Sorry, I am kinda busy these months so I wasn't able to properly work on this. Can you try applying this pr? https://github.com/kripken/emscripten/pull/4378