//---------------------------------------------------------------------------- // TelnetTCPClient::TelnetTCPClient(int SocketDescriptor, QObject *parent) : QObject(parent) { strCR = "\r\n"; strShell = QString(">"); CommandBuffer.clear(); isAuthenticated = false; SessionID = SocketDescriptor; Socket = new QTcpSocket(this); if(!Socket->setSocketDescriptor(SessionID)) { std::cerr << SessionID << " Error binding socket\n"; return; } telnetLogic = new TelnetLogic(this); //connect the signals connect( Socket, SIGNAL(readyRead()), this, SLOT(SocketReadyRead()), Qt::DirectConnection); connect( Socket, SIGNAL(disconnected()), this, SLOT(SocketDisconnected()), Qt::DirectConnection); std::cout << SessionID << " Session Connected.\n"; SendResponse(QString("[ Command Shell ]") + strCR); SendResponse(QString("Enter a password: ")); }
RobotControl::RobotControl(QObject *parent) : QObject(parent), vertSpeed(0), moveSpeed(0), rotateSpeed(0), initialized(false), manualControl(false), currentState(Stop) { lastEngine = 0; connect(&socket, SIGNAL(disconnected()), this, SLOT(SocketDisconnected())); }
void ArduinoThread::Disconnected() { sock = 0; emit SocketDisconnected(); }
void MessageHandler::HandleDisconnected() { SocketDisconnected(); // Emits this signal }