Fixed merge for some reason.
This commit is contained in:
commit
6ded352265
@ -4,8 +4,7 @@
|
|||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "TCPSession.h"
|
#include "TCPSession.h"
|
||||||
|
|
||||||
namespace core
|
namespace core {
|
||||||
{
|
|
||||||
|
|
||||||
TCPServer::TCPServer(EPoll &ePoll, IPAddress address, std::string delimiter, int depth, std::string text)
|
TCPServer::TCPServer(EPoll &ePoll, IPAddress address, std::string delimiter, int depth, std::string text)
|
||||||
: TCPSocket(ePoll, text), commands(delimiter, depth) {
|
: TCPSocket(ePoll, text), commands(delimiter, depth) {
|
||||||
@ -68,7 +67,7 @@ namespace core
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPServer::removeFromSessionList(TCPSession *session) {
|
void TCPServer::removeFromSessionList(TCPSession *session) {
|
||||||
std::vector<TCPSession *>::iterator cursor;
|
std::vector<TCPSession *>::iterator cursor;
|
||||||
lock.lock();
|
lock.lock();
|
||||||
@ -79,7 +78,7 @@ namespace core
|
|||||||
}
|
}
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPServer::sessionErrorHandler(std::string errorString, std::stringstream &out) {
|
void TCPServer::sessionErrorHandler(std::string errorString, std::stringstream &out) {
|
||||||
throw coreutils::Exception(errorString);
|
throw coreutils::Exception(errorString);
|
||||||
}
|
}
|
||||||
@ -105,7 +104,7 @@ namespace core
|
|||||||
|
|
||||||
void TCPServer::sendToAll(std::stringstream &data) {
|
void TCPServer::sendToAll(std::stringstream &data) {
|
||||||
for (auto session : sessions)
|
for (auto session : sessions)
|
||||||
session->write(data.str());
|
session->write(data.str());
|
||||||
data.str("");
|
data.str("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,7 @@ namespace core
|
|||||||
/// process commands to display status information.
|
/// process commands to display status information.
|
||||||
///
|
///
|
||||||
|
|
||||||
class TCPServer : public TCPSocket, public Command
|
class TCPServer : public TCPSocket, public Command {
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
@ -121,7 +120,7 @@ namespace core
|
|||||||
/// Use the getSessionByAlias to retrieve a session pointer by the value
|
/// Use the getSessionByAlias to retrieve a session pointer by the value
|
||||||
/// of the alias pointer.
|
/// of the alias pointer.
|
||||||
///
|
///
|
||||||
|
|
||||||
TCPSession *getSessionByAlias(void *alias);
|
TCPSession *getSessionByAlias(void *alias);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user