Initial repository 1.0.0
This commit is contained in:
commit
d8b1275884
1861 files changed
+66342
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#include "ConsoleServer.h"
|
||||
#include "ConsoleSession.h"
|
||||
#include "Command.h"
|
||||
#include "Log.h"
|
||||
|
||||
namespace core {
|
||||
|
||||
ConsoleServer::ConsoleServer(EPoll &ePoll, std::string url, short int port)
|
||||
: TCPServerSocket(ePoll, url, port) {
|
||||
Log(this);
|
||||
}
|
||||
|
||||
ConsoleServer::~ConsoleServer() {}
|
||||
|
||||
void ConsoleServer::sendToConnectedConsoles(std::string out) {
|
||||
for(auto *session : sessions)
|
||||
((ConsoleSession *)session)->writeLog(out);
|
||||
}
|
||||
|
||||
Session * ConsoleServer::getSocketAccept() {
|
||||
return new ConsoleSession(ePoll, *this);
|
||||
}
|
||||
|
||||
void ConsoleServer::output(Session *session) {
|
||||
session->out << "|" << session->ipAddress.getClientAddressAndPort();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user