merge conflicts resolution with develop->master.
This commit is contained in:
commit
1d16d0c17f
2
EPoll.h
2
EPoll.h
@ -32,7 +32,7 @@ namespace core {
|
||||
|
||||
public:
|
||||
|
||||
volatile long long eventId = 0;
|
||||
long long eventId = 0;
|
||||
|
||||
///
|
||||
/// The constructor for the BMAEPoll object.
|
||||
|
@ -7,21 +7,18 @@
|
||||
namespace core
|
||||
{
|
||||
|
||||
TCPSession::TCPSession(EPoll &ePoll, TCPServer &server, std::string text) : TCPSocket(ePoll, text), server(server)
|
||||
{
|
||||
TCPSession::TCPSession(EPoll &ePoll, TCPServer &server, std::string text) : TCPSocket(ePoll, text), server(server) {
|
||||
uuid_t uuid;
|
||||
uuid_generate(uuid);
|
||||
alias = coreutils::MString((char *)uuid, 26);
|
||||
}
|
||||
|
||||
TCPSession::~TCPSession()
|
||||
{
|
||||
TCPSession::~TCPSession() {
|
||||
server.removeFromSessionList(this);
|
||||
server.subscriptions.removeSessionSubscriptions(*this);
|
||||
}
|
||||
|
||||
void TCPSession::output(std::stringstream &data)
|
||||
{
|
||||
void TCPSession::output(std::stringstream &data) {
|
||||
data << "|" << ipAddress.getClientAddressAndPort();
|
||||
}
|
||||
|
||||
@ -77,35 +74,30 @@ namespace core
|
||||
}
|
||||
}
|
||||
|
||||
void TCPSession::setBlockSize(int blockSize)
|
||||
{
|
||||
void TCPSession::setBlockSize(int blockSize) {
|
||||
this->blockSize = blockSize;
|
||||
}
|
||||
|
||||
void TCPSession::onLineReceived(coreutils::ZString &line)
|
||||
{
|
||||
void TCPSession::onLineReceived(coreutils::ZString &line) {
|
||||
protocol(line);
|
||||
send();
|
||||
if (term)
|
||||
shutdown("termination requested");
|
||||
}
|
||||
|
||||
void TCPSession::onBlockReceived(coreutils::ZString &block)
|
||||
{
|
||||
void TCPSession::onBlockReceived(coreutils::ZString &block) {
|
||||
coreutils::Log(coreutils::LOG_DEBUG_3) << "[" << block.getLength() << "]";
|
||||
if (term)
|
||||
shutdown("termination requested");
|
||||
}
|
||||
|
||||
void TCPSession::send()
|
||||
{
|
||||
void TCPSession::send() {
|
||||
if (out.tellp() > 0)
|
||||
write(out.str());
|
||||
out.str("");
|
||||
}
|
||||
|
||||
void TCPSession::terminate()
|
||||
{
|
||||
void TCPSession::terminate() {
|
||||
term = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user