/*! @brief Constructs a CommandSendingSocket
 *  @param parent The parent object
 */
CommandSendingSocket::CommandSendingSocket(RemoteCommand* command, QHostAddress clientAddress, int clientPort, QObject* parent) :
    QTcpSocket(parent),
    _command(command),
    _clientAddress(clientAddress),
    _clientPort(clientPort)
{
    connect(this, SIGNAL(connected()), this, SLOT(sendCommand()));
    connect(this, SIGNAL(disconnected()), this, SLOT(connectionClosedByClient()));
    connect(this, SIGNAL(readyRead()), this, SLOT(readResponse()));
    connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(errorOccured(QAbstractSocket::SocketError)));
}
bool WorkStation::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: updateTimer(); break;
    case 1: status(); break;
    case 2: user(); break;
    case 3: connectionClosedByClient(); break;
    case 4: readFromClient(); break;
    case 5: socketError((int)static_QUType_int.get(_o+1)); break;
    case 6: sendCommand(); break;
    case 7: sendCommandTime(); break;
    case 8: blockSlot(); break;
    case 9: delayBlocked(); break;
    case 10: wakeUp(); break;
    case 11: connectionTimeout(); break;
    default:
	return QObject::qt_invoke( _id, _o );
    }
    return TRUE;
}