idleTimeoutState = new QState(connectedState);
sendState = new QState(connectedState);
waitState = new QState(connectedState);
- recieveState = new QState;
- recieveFailState = new QState;
+ receiveState = new QState;
+ receiveFailState = new QState;
connectedHistoryState = new QHistoryState(connectedState);
stateMachine->addState(errorState);
stateMachine->addState(disconnectedState);
stateMachine->addState(connectingState);
stateMachine->addState(connectedState);
- stateMachine->addState(recieveState);
- stateMachine->addState(recieveFailState);
+ stateMachine->addState(receiveState);
+ stateMachine->addState(receiveFailState);
stateMachine->setInitialState(disconnectedState);
connectedState->setInitialState(sendState);
errorState->addTransition(this, SIGNAL(clearErrorsRequested()), disconnectedState);
connectedState->addTransition(this, SIGNAL(startDisconnecting()), disconnectedState);
- connectedState->addTransition(socket, SIGNAL(readyRead()), recieveState);
- connectedState->addTransition(this, SIGNAL(sendFailed()), recieveFailState);
+ connectedState->addTransition(socket, SIGNAL(readyRead()), receiveState);
+ connectedState->addTransition(this, SIGNAL(sendFailed()), receiveFailState);
disconnectedState->addTransition(this, SIGNAL(startConnecting()), connectingState);
idleTimeoutState->addTransition(this, SIGNAL(startSending()), sendState);
- recieveState->addTransition(this, SIGNAL(authenticated()), authenticatingState);
- recieveState->addTransition(this, SIGNAL(connectionError()), errorState);
- recieveState->addTransition(this, SIGNAL(replyRecieved()), connectedHistoryState);
+ receiveState->addTransition(this, SIGNAL(authenticated()), authenticatingState);
+ receiveState->addTransition(this, SIGNAL(connectionError()), errorState);
+ receiveState->addTransition(this, SIGNAL(replyReceived()), connectedHistoryState);
- recieveFailState->addTransition(this, SIGNAL(connectionError()), errorState);
- recieveFailState->addTransition(sendState);
+ receiveFailState->addTransition(this, SIGNAL(connectionError()), errorState);
+ receiveFailState->addTransition(sendState);
// ------------ END Transitions -------------------
// ------------- Methods ---------------------
QObject::connect(idleState, SIGNAL(exited()), this, SLOT(exitIdleState()));
QObject::connect(idleTimeoutState, SIGNAL(entered()), this, SLOT(enterIdleTiemoutState()));
- QObject::connect(recieveState, SIGNAL(entered()), this, SLOT(enterRecieveState()));
- QObject::connect(recieveFailState, SIGNAL(entered()), this, SLOT(enterRecieveFailState()));
+ QObject::connect(receiveState, SIGNAL(entered()), this, SLOT(enterReceiveState()));
+ QObject::connect(receiveFailState, SIGNAL(entered()), this, SLOT(enterReceiveFailState()));
// ------------ END Methods -------------------
stateMachine->start();
}
}
-void Client::enterRecieveState()
+void Client::enterReceiveState()
{
#ifdef ANIDBUDPCLIENT_CLIENT_STATE_MACHINE_DEBUG
-qDebug() << "Entering Recieve State";
+qDebug() << "Entering Receive State";
#endif
while (socket->hasPendingDatagrams())
{
if (sender != m_hostAddress)
{
- qWarning() << QString("Recieved datagram from unknown host: %1 port: %2\nRaw datagram contents:%3\nDiscarding datagram.")
+ qWarning() << QString("Received datagram from unknown host: %1 port: %2\nRaw datagram contents:%3\nDiscarding datagram.")
.arg(sender.toString())
.arg(senderPort)
.arg(tmp.constData());
QString reply = QString::fromUtf8(tmp);
#ifdef ANIDBUDPCLIENT_CLIENT_COMMAND_DEBUG
-qDebug() << QString("Recieved datagram from [%1]:%2\nRaw datagram contents:%3")
+qDebug() << QString("Received datagram from [%1]:%2\nRaw datagram contents:%3")
.arg(m_host)
.arg(senderPort)
.arg(reply);
continueLoop:
;
}
- // replyRecieved() should be emitted on success
- // all connection errors go directly to endLoops
- emit replyRecieved();
+ // replyReceived() should be emitted on success
+ // all connection errors go directly to endLoop
+ emit replyReceived();
endLoop:
;
}
-void Client::enterRecieveFailState()
+void Client::enterReceiveFailState()
{
#ifdef ANIDBUDPCLIENT_CLIENT_STATE_MACHINE_DEBUG
-qDebug() << "Entering RecieveFail State";
+qDebug() << "Entering ReceiveFail State";
#endif
if (commandsTimedOut < 3)
return;