The problem with the interprocess communication
-
Hello! I am really sorry for my bad English.
I'm trying to create a program that will make connection with network device (switch) via TELNET protocol and execute some device configuration.
To establish TELNET connection, my program uses another program, - "Netcat". I want to use switch output (Netcat's output stream) to control configuration process (check switch answers to my commands) and Netcat's input stream, to control switch.
Here is my simple test program to explore this possibility:
@#include <QCoreApplication>
#include <QProcess>
#include <QTimer>int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QProcess *telnet = new QProcess;
telnet->setProcessChannelMode(QProcess::MergedChannels);
telnet->setProcessChannelMode(QProcess::ForwardedChannels);QString location = "C:/Users/Konstantin/Desktop/nc111nt/nc"; QStringList arguments; arguments << "-t" << "10.50.15.254" << "23"; telnet->start(location, arguments); if(!telnet->waitForStarted()) { return 1; } return a.exec();
}@
So, in Wireshark program I see, that Netcat establish TELNET connection with 10.50.15.254, but my program doesn't show switch command promt at runtime.
When I stop debugging process in Qt Creator, I see, that my program show switch command promt.
Please, help me establish a process of exchange of information between Netcat program and my program at runtime.