Working Version
This commit is contained in:
parent
46f98dff69
commit
20d5c99517
@ -8,11 +8,12 @@ namespace core {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Command::output(Session *session) {}
|
||||
void Command::output(std::stringstream &out) {
|
||||
out << "Write your own command description here for the help system." << std::endl;
|
||||
}
|
||||
|
||||
bool Command::check(coreutils::ZString request) {
|
||||
return request[0].equals(name);
|
||||
|
||||
}
|
||||
|
||||
void Command::setName(std::string name) {
|
||||
|
@ -58,7 +58,7 @@ namespace core {
|
||||
/// @param session The session that will receive the output.
|
||||
///
|
||||
|
||||
virtual void output(Session *session);
|
||||
virtual void output(std::stringstream &out);
|
||||
|
||||
///
|
||||
/// Set the name of this command used in default rule checking during request parsing.
|
||||
|
@ -113,7 +113,7 @@ namespace core {
|
||||
event.data.ptr = socket;
|
||||
event.events = EPOLLIN | EPOLLONESHOT | EPOLLRDHUP | EPOLLET;
|
||||
if(socket->needsToWrite())
|
||||
event.events |= EPOLLWRNORM;
|
||||
event.events |= EPOLLWRNORM;
|
||||
epoll_ctl(epfd, EPOLL_CTL_MOD, socket->getDescriptor(), &event);
|
||||
}
|
||||
|
||||
|
@ -63,10 +63,8 @@ namespace core {
|
||||
return new TCPSession(ePoll, *this);
|
||||
}
|
||||
|
||||
void TCPServer::output(TCPSession *session) {
|
||||
std::stringstream out;
|
||||
out << "|" << session->ipAddress.getClientAddressAndPort();
|
||||
session->send();
|
||||
void TCPServer::output(std::stringstream &out) {
|
||||
out << "Use the 'help' command to list the commands for this server." << std::endl;
|
||||
}
|
||||
|
||||
int TCPServer::processCommand(coreutils::ZString &request, TCPSession &session) {
|
||||
|
@ -85,7 +85,7 @@ namespace core {
|
||||
|
||||
void removeFromSessionList(TCPSession *session);
|
||||
|
||||
void output(TCPSession *session); ///<Output the consoles array to the console.
|
||||
void output(std::stringstream &out); ///<Output the consoles array to the console.
|
||||
|
||||
///
|
||||
///
|
||||
|
@ -22,7 +22,7 @@ namespace core {
|
||||
|
||||
void TCPSession::onRegistered() {
|
||||
onConnected();
|
||||
protocol((char *)"");
|
||||
protocol(coreutils::ZString(""));
|
||||
send();
|
||||
if(term)
|
||||
shutdown("termination requested");
|
||||
|
@ -33,7 +33,6 @@ namespace core {
|
||||
data << "|" << getCount();
|
||||
}
|
||||
|
||||
|
||||
void Thread::run() {
|
||||
|
||||
threadId = syscall(SYS_gettid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user