parent
31d3cef093
commit
6c54c4740d
|
@ -699,13 +699,12 @@ public:
|
||||||
Accepter(int socket)
|
Accepter(int socket)
|
||||||
: m_socket_watcher(socket, FdEvents::Read,
|
: m_socket_watcher(socket, FdEvents::Read,
|
||||||
[this](FDWatcher&, FdEvents, EventMode mode) {
|
[this](FDWatcher&, FdEvents, EventMode mode) {
|
||||||
if (mode == EventMode::Normal)
|
handle_available_input(mode);
|
||||||
handle_available_input();
|
|
||||||
})
|
})
|
||||||
{}
|
{}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void handle_available_input()
|
void handle_available_input(EventMode mode)
|
||||||
{
|
{
|
||||||
const int sock = m_socket_watcher.fd();
|
const int sock = m_socket_watcher.fd();
|
||||||
try
|
try
|
||||||
|
@ -713,7 +712,7 @@ private:
|
||||||
while (not m_reader.ready() and fd_readable(sock))
|
while (not m_reader.ready() and fd_readable(sock))
|
||||||
m_reader.read_available(sock);
|
m_reader.read_available(sock);
|
||||||
|
|
||||||
if (not m_reader.ready())
|
if (mode != EventMode::Normal or not m_reader.ready())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (m_reader.type())
|
switch (m_reader.type())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user