| 163 | } |
| 164 | |
| 165 | void Connection::enterEventLoop() |
| 166 | { |
| 167 | while (true) |
| 168 | { |
| 169 | // Process one pending event |
| 170 | (void)processPendingEvent(); |
| 171 | |
| 172 | // And go to poll(), which wakes us up right away |
| 173 | // if there's another pending event, or sleeps otherwise. |
| 174 | auto success = waitForNextEvent(); |
| 175 | if (!success) |
| 176 | break; // Exit I/O event loop |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void Connection::enterEventLoopAsync() |
| 181 | { |