Fixed cross socket writing issue with epoll scheduler.

This commit is contained in:
Brad Arant committed 2022-03-15 23:53:22 +00:00
1 parent c918e42290
commit 08561f6dc3
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -61,6 +61,7 @@ namespace core {
void Socket::onUnregistered() {}
bool Socket::eventReceived(struct epoll_event event) {
inHandler = true;
if(event.events & EPOLLRDHUP) {
readHangup = true;
shutdown("hangup received");
@@ -75,6 +76,7 @@ namespace core {
else if(event.events & EPOLLHUP) {
shutdown();
}
inHandler = false;
return !shutDown;
}
@@ -137,6 +139,8 @@ namespace core {
outlock.lock();
fifo.emplace(data);
outlock.unlock();
if(!inHandler)
ePoll.resetSocket(this);
return 1;
}
+1 -1
View File
@@ -170,7 +170,7 @@ namespace core {
// std::mutex lock;
std::mutex outlock;
bool readHangup = false;
bool inHandler = false;
// struct epoll_event event; // Event selection construction structure.
//-------------------------------------------------------------------------------------