26 lines
538 B
C++
Executable File
26 lines
538 B
C++
Executable File
|
|
|
|
|
|
#include "cbi_shutdown.h"
|
|
#include "tcpserver.h"
|
|
|
|
CBI_Shutdown::CBI_Shutdown(unsigned short port)
|
|
: CommandInterface(port, "SHUTDOWN")
|
|
{
|
|
connect(this, &CBI_Shutdown::shutdownRequest,
|
|
TcpServer::instance(port), &TcpServer::shutdownRequest);
|
|
}
|
|
|
|
void CBI_Shutdown::handleCommandInternal(const QVector<QByteArray> &)
|
|
{
|
|
writeOk(QLatin1String("Shutting down server - bye!"));
|
|
closeConnection();
|
|
emit shutdownRequest();
|
|
}
|
|
|
|
QString CBI_Shutdown::help() const
|
|
{
|
|
return QLatin1String("SHUTDOWN - shut down the server");
|
|
}
|
|
|