Skip to content

Prevent 'cli' prompt being displayed on main thread. #134

Answered by daniele77
patrickn asked this question in Q&A
Discussion options

You must be logged in to vote

Well, a stream is not displayed on "a thread", it's displayed on "a console".
If you don't want the standard console output but only the remote console (i.e., telnet), you simply don't instantiate CliLocalTerminalSession.
E.g.:

    MainScheduler scheduler;
    // local session not needed
    /*
    CliLocalTerminalSession localSession(cli, scheduler, std::cout, 200);
    localSession.ExitAction(
        [&scheduler](auto& out) // session exit action
        {
            out << "Closing App...\n";
            scheduler.Stop();
        }
    );
    */

    // setup server

    CliTelnetServer server(cli, scheduler, 5000);
    // exit action for all the connections
    server.ExitAction( []…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@patrickn
Comment options

Answer selected by patrickn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants