Synced up to Matts code.
This commit is contained in:
1 parent
d8eb3d7bb2
commit
b63b4785cf
85 files changed
+458
-567
No files matched your search
+2
-30
@@ -8,31 +8,7 @@ namespace core
|
||||
{
|
||||
|
||||
TCPServer::TCPServer(EPoll &ePoll, IPAddress address, std::string delimiter, int depth, std::string text)
|
||||
<<<<<<< HEAD
|
||||
: TCPSocket(ePoll, text), commands(delimiter, depth) {
|
||||
|
||||
commands.add(subscriptions, "publish");
|
||||
commands.add(subscriptions, "unpublish");
|
||||
commands.add(subscriptions, "subscribe");
|
||||
commands.add(subscriptions, "unsubscribe");
|
||||
commands.add(subscriptions, "catalog");
|
||||
commands.add(subscriptions, "event");
|
||||
|
||||
setDescriptor(socket(AF_INET, SOCK_STREAM, 0));
|
||||
int yes = 1;
|
||||
setsockopt(getDescriptor(), SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
|
||||
|
||||
if(bind(getDescriptor(), address.getPointer(), address.addressLength) < 0)
|
||||
throw coreutils::Exception("Error on bind to socket: " + std::to_string(errno));
|
||||
|
||||
if(listen(getDescriptor(), 20) < 0)
|
||||
throw coreutils::Exception("Error on listen to socket");
|
||||
|
||||
}
|
||||
=======
|
||||
: TCPSocket(ePoll, text), commands(delimiter, depth)
|
||||
{
|
||||
>>>>>>> subscription
|
||||
: TCPSocket(ePoll, text), commands(delimiter, depth) {
|
||||
|
||||
commands.add(subscriptions, "publish");
|
||||
commands.add(subscriptions, "unpublish");
|
||||
@@ -158,13 +134,9 @@ namespace core
|
||||
{
|
||||
coreutils::Log(coreutils::LOG_DEBUG_1) << alias;
|
||||
for (auto session : sessions)
|
||||
if (compareAlias(session->alias, alias))
|
||||
if (session->compareAlias(alias))
|
||||
return session;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool TCPServer::compareAlias(void *alias, void *compare)
|
||||
{
|
||||
return alias == compare;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user