Ole Christian Eidheim

Results 316 comments of Ole Christian Eidheim

Just a quick response regarding making the 100 requests with `io_service->run()` on each call, you need to call `service->reset()` before calling the second `io_service->run()`. For instance, try apply the following...

If you already are using the server's io_service, copy that into your clients and call server->start(). If you are using one server thread, only one event thread will be running...

@SethHamilton Regarding your last update: here is an example server and client both using the same io_service running on 1 thread (all handlers, server and client handlers, are run sequentially):...

Could you have a second look at my example above? The clients using an external io_service should not stall as long as the external io_service is running (waiting for tasks/work)....

Make sure you never call io_service::run several times and never call io_service::reset. My assumption here is that you call io_service::run in only one server object, and that you only use...

Also linking to another example I have created where two servers use the same io_service: https://gitlab.com/eidheim/desktop-stream/blob/master/main.cpp edit: desktop-stream moved to gitlab

My bad, sorry for the conflicting explanations. Here is a better example: ```c++ #include "client_http.hpp" #include "server_http.hpp" using namespace std; using HttpClient = SimpleWeb::Client; using HttpServer = SimpleWeb::Server; int main()...

I updated the example above just now.

Posting jobs to io_service is thread safe yes.

Also make sure you do not use the client’s synchronous request calls, since they use io_service reset and run internally.