Beispiel #1
0
void SftpChannelPrivate::handleCurrentPacket()
{
#ifdef CREATOR_SSH_DEBUG
    qDebug("Handling SFTP packet of type %d", m_incomingPacket.type());
#endif
    switch (m_incomingPacket.type()) {
    case SSH_FXP_VERSION:
        handleServerVersion();
        break;
    case SSH_FXP_HANDLE:
        handleHandle();
        break;
    case SSH_FXP_NAME:
        handleName();
        break;
    case SSH_FXP_STATUS:
        handleStatus();
        break;
    case SSH_FXP_DATA:
        handleReadData();
        break;
    case SSH_FXP_ATTRS:
        handleAttrs();
        break;
    default:
        throw SshServerException(SSH_DISCONNECT_PROTOCOL_ERROR,
            "Unexpected packet.",
            tr("Unexpected packet of type %1.").arg(m_incomingPacket.type()));
    }
}
Beispiel #2
0
void Connector::stopRead()
{
    qDebug("stop Read");
    disconnect(this, SIGNAL(readyRead()), this, SLOT(handleReadyRead()));
    disconnect(this, SIGNAL(readAllData()), this, SLOT(handleReadData()));
    //清空
    ba.clear();
    clear();
}
Beispiel #3
0
AsyncDNS::AsyncDNS(QHostAddress host, quint16 port, QObject *parent) : QObject(parent)
{
    socket = new QUdpSocket(this);
    DNS_server = host;
    DNS_port   = port;

    socket->bind(DNS_port);

    connect(socket, SIGNAL(readyRead()) , this, SLOT(handleReadData()) );
    connect(this, SIGNAL(resolve(QString)), this, SLOT(onResolve(QString)) );
}
Beispiel #4
0
void Connector::startRead(qint8 start, qint8 num)
{
    qDebug("start Read");
    exceptByte = 5 + 48 * num;  // 数据头+数据
    qDebug()<<QString("start = %1, num = %2").arg(start).arg(num);
    stopRead();
    connect(this, SIGNAL(readyRead()), this, SLOT(handleReadyRead()));
    connect(this, SIGNAL(readAllData()), this, SLOT(handleReadData()));
    this->start = start;
    this->num = num;
    callForData(start, num);
}
SerialCommandQueue::SerialCommandQueue(QObject *parent) : QObject(parent)
{
    serial = new QSerialPort(this);
    serial->setSettingsRestoredOnClose(false);

    connect(serial, SIGNAL(error(QSerialPort::SerialPortError)),
            this, SLOT(handleSerialError(QSerialPort::SerialPortError)));
    connect(serial, SIGNAL(readyRead()), this, SLOT(handleReadData()));

    commandTimeoutTimer.setSingleShot(true);

    connect(&commandTimeoutTimer, SIGNAL(timeout()),
            this, SLOT(handleCommandTimeout()));
}