Subversion Repositories tpanel

Rev

Rev 17 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 21
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2018 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2018 to 2021 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 326... Line 326...
326
            asio::ip::tcp::resolver r(io_context);
326
            asio::ip::tcp::resolver r(io_context);
327
            start(r.resolve(TConfig::getController(), to_string(TConfig::getPort())), panelID);
327
            start(r.resolve(TConfig::getController(), to_string(TConfig::getPort())), panelID);
328
            io_context.run();
328
            io_context.run();
329
            MSG_TRACE("Thread ended.");
329
            MSG_TRACE("Thread ended.");
330
 
330
 
331
            if (stopped_)
331
            if (stopped_ || prg_stopped || killed)
332
                break;
332
                break;
333
        }
333
        }
334
        catch (std::exception& e)
334
        catch (std::exception& e)
335
        {
335
        {
336
            MSG_ERROR("Error connecting to " << TConfig::getController() << ":" << to_string(TConfig::getPort()) << " [" << e.what() << "]");
336
            MSG_ERROR("Error connecting to " << TConfig::getController() << ":" << to_string(TConfig::getPort()) << " [" << e.what() << "]");
Line 417... Line 417...
417
                // Start the output actor.
417
                // Start the output actor.
418
                if (isRunning())
418
                if (isRunning())
419
                    start_write();
419
                    start_write();
420
            }
420
            }
421
 
421
 
422
            if (!stopped_ && killed)
422
            if (!stopped_ && (killed || prg_stopped))
423
                stop();
423
                stop();
424
        }
424
        }
425
        catch (std::exception& e)
425
        catch (std::exception& e)
426
        {
426
        {
427
            MSG_ERROR("Error: " << e.what());
427
            MSG_ERROR("Error: " << e.what());
Line 537... Line 537...
537
    DECL_TRACER("TAmxNet::handle_read(const error_code& error, size_t n, R_TOKEN tk)");
537
    DECL_TRACER("TAmxNet::handle_read(const error_code& error, size_t n, R_TOKEN tk)");
538
 
538
 
539
    if (!isRunning())
539
    if (!isRunning())
540
        return;
540
        return;
541
 
541
 
542
    if (killed)
542
    if (killed || prg_stopped)
543
    {
543
    {
544
        stop();
544
        stop();
545
        return;
545
        return;
546
    }
546
    }
547
 
547