I'm using visual studio 2015.
I have main loop, where I handle new connections to server:
acceptor = new boost::asio::ip::tcp::acceptor(service, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), 8001));//boost::asio::ip::address::from_string("xx.xx.xx.xx"), 80)
std::cout << "Waiting for clients..." << std::endl;
boost::asio::ip::tcp::socket* clientSock = new boost::asio::ip::tcp::socket (service);
std::cout << "New client joined! " << std::endl;
Client* new_client = new Client; //create new client
new_client->clientSock = clientSock;
new_client->last_read_request = "";
new_client->activity = TRUE;
new_client->request_thread = new boost::thread(&Server::HandleRequest, this, new_client);//new thread with handling client requests
std::cout << "Total clients:" << clients_list->size() << std::endl;
void Server::HandleRequest(Client * Client_to_handle)
int iterator = 0;
//do stuff and drop iterator to zero (connection active)
iterator = 0;
else if (iterator >= 10) //program refuses to get in here
if (iterator == 20)
Client_to_handle->activity = FALSE;
(I would like to comment, but do not have the rights yet!)
Are you sure that you are running a proper "debug" build where you still have all symbols left in place? It can happen, that you are having compiler optimizations enabled, which can lead to changing the order of statements and can completely eliminate variables.
I leave the link to the VC++ optimizations flags: https://msdn.microsoft.com/en-us/library/k1ack8f1.aspx?f=255&MSPPError=-2147217396
Check you compiler flags and see if you have any kind of
/O in there.