Added IPAddressList capability and whitelist/blacklist capability.
This commit is contained in:
1 parent
2b9749c4b2
commit
5e5e626d28
9 files changed
+111
-24
No files matched your search
+8
-17
@@ -37,7 +37,7 @@ namespace core {
|
||||
this->length = length;
|
||||
}
|
||||
|
||||
void Socket::onRegistered() {
|
||||
void Socket::onRegistered() {
|
||||
onConnected();
|
||||
}
|
||||
|
||||
@@ -47,27 +47,18 @@ namespace core {
|
||||
|
||||
void Socket::eventReceived(struct epoll_event event) {
|
||||
|
||||
// std::stringstream stream;
|
||||
// stream << "Event received on socket " << event.data.fd << ": ";
|
||||
// if(event.events & EPOLLRDHUP) stream << "EPOLLRDHUP ";
|
||||
// if(event.events & EPOLLIN) stream << "EPOLLIN ";
|
||||
// if(event.events & EPOLLOUT) stream << "EPOLLOUT ";
|
||||
// if(event.events & EPOLLERR) stream << "EPOLLERR ";
|
||||
// stream << "[" << event.events << "]";
|
||||
// BMALog(LOG_DEBUG_4) << stream.str();
|
||||
//
|
||||
if(event.events & EPOLLRDHUP) {
|
||||
Log(LOG_DEBUG_2) << "Socket " << descriptor << " received disconnect from client.";
|
||||
shutdown();
|
||||
return;
|
||||
Log(LOG_DEBUG_2) << "Socket " << descriptor << " received disconnect from client.";
|
||||
shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
if(event.events & EPOLLIN)
|
||||
receiveData(buffer, length);
|
||||
|
||||
receiveData(buffer, length);
|
||||
|
||||
if(event.events & EPOLLOUT)
|
||||
writeSocket();
|
||||
|
||||
writeSocket();
|
||||
|
||||
enable(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user