software/final/alf_car/src/communication/server/Server.cpp
void Server::run() {

    waitForClient();

    try {

            //sendDataAtStart();
            while (true) {
                // receiving command from client
                sock->receiving(cmd);
                // execute this command
                actions(cmd);

            }

        } catch (SocketException& e) {

            std::cout << "SocketException was caught: " << e.description() << std::endl;
            connected = false;
            // stop slammap thread
            run();
        }
}
/**
 * Server run thread to handle incoming commands
 */
Server run thread to handle incoming commands
Server run thread to handle incoming commands
void Server::run() {
    waitForClient();
    try {
            while (true) {
                sock->receiving(cmd);
                actions(cmd);
            }
        } catch (SocketException& e) {
            std::cout << "SocketException was caught: " << e.description() << std::endl;
            connected = false;
            run();
        }
}
void Server :: run ( ) { waitForClient ( ) ; try { while ( true ) { sock -> receiving ( cmd ) ; actions ( cmd ) ; } } catch ( SocketException & e ) { std :: cout << " " << e . description ( ) << std :: endl ; connected = false ; run ( ) ; } }
Server run thread to handle incoming commands
Server run thread to handle incoming commands
//sendDataAtStart(); // receiving command from client // execute this command // stop slammap thread