boost-exception

boost coroutine server crashes when writting data to client

旧城冷巷雨未停 提交于 2019-12-08 03:33:06
问题 I made my server based on boost coroutine echo server example, simply receives and writes back some data. It crashes when writing data to client, and more strangely, it only crashes when using mutiple cores. Here's the server, it reads 4 bytes and write back "OK", within 1 second as timeout: #include <winsock2.h> #include <windows.h> #include <iostream> using namespace std; #include <boost/thread/thread.hpp> #include <boost/asio.hpp> #include <boost/asio/spawn.hpp> using namespace boost;