“An existing connection was forcibly closed by the remote host” when listening for incoming data
问题 When working with boost asio, I've stumbled upon some weird behavior, which I don't quite understand. I wrote a minimal test-program to replicate the problem: #include <boost/asio.hpp> #include <iostream> using boost::asio::ip::udp; int main(int argc,char *argv[]) { boost::asio::io_service ioService; udp::resolver resolver(ioService); udp::resolver::query queryListen("127.0.0.1","50001"); auto epListen = *resolver.resolve(queryListen); udp::socket socket(ioService,epListen); udp::resolver: