2019-02-07 13:28:21 -08:00
|
|
|
#include "ConsoleServer.h"
|
|
|
|
|
#include "ConsoleSession.h"
|
|
|
|
|
#include "Command.h"
|
|
|
|
|
#include "Log.h"
|
|
|
|
|
|
|
|
|
|
namespace core {
|
2021-08-07 11:47:54 -07:00
|
|
|
|
2021-09-23 16:28:32 -07:00
|
|
|
ConsoleServer::ConsoleServer(EPoll &ePoll, IPAddress address) : TCPServer(ePoll, address, " ", 10, "Console Server") {
|
2021-08-07 11:47:54 -07:00
|
|
|
coreutils::Log(this);
|
2019-09-20 20:25:45 -07:00
|
|
|
}
|
2021-08-07 11:47:54 -07:00
|
|
|
|
2019-09-13 09:16:55 -07:00
|
|
|
void ConsoleServer::logSend(std::string out) {
|
2021-08-07 11:47:54 -07:00
|
|
|
for(auto *session : sessions)
|
2019-09-13 09:16:55 -07:00
|
|
|
((ConsoleSession *)session)->writeLog(out);
|
2019-02-07 13:28:21 -08:00
|
|
|
}
|
2021-08-07 11:47:54 -07:00
|
|
|
|
2019-09-18 18:32:15 -07:00
|
|
|
TCPSession * ConsoleServer::getSocketAccept(EPoll &ePoll) {
|
|
|
|
|
return new ConsoleSession(ePoll, *this);
|
|
|
|
|
}
|
2021-08-07 11:47:54 -07:00
|
|
|
|
2019-02-07 13:28:21 -08:00
|
|
|
}
|