I have a C++ Server that a client application is able to connect to but after the client connect the server crashes. I found the code causing it by commenting it out and it not crashing anymore. The part that crashes is when it gets ready to read, I know it doesn't get past this point cause it crashes before I send a message from the client. bellow is the read code
try
{
Logger::Log("Client Listing for message!");
boost::asio::async_read(socket_,
boost::asio::buffer(readMsg_.Data(), Message::header),
boost::bind(&Client::HandleReadHeader, this,
boost::asio::placeholders::error));
}
catch (std::exception& e)
{
Logger::Log("Error: " + std::string(e.what()));
}
edit: The try-catch statement doesnt catch anything it just crashes so I am unsure what is wrong
Edit*: I recreated the GUI project witch starts this code, witch is a dll. After I recreated that project, no changes besides different project in the solution, It no longer crashes but the throw-catch statement now catches a error.
Error: The network connection was aborted by the local system
not sure why it's getting aborted