Commit e896943b authored by 王思远's avatar 王思远

UTC:2025-11-25 8:53:49 :

parent b6f96457
......@@ -438,6 +438,7 @@ int main(int argc, char *argv[])
// Handle signal.
auto onSignal = [](int) -> void {
// Emit quit event.
::std::uint64_t v = 1;
::write(quitEvent, &v, sizeof(v));
};
......@@ -474,8 +475,10 @@ int main(int argc, char *argv[])
for (auto &status : fds) {
if (status.revents & POLLIN) {
if (status.fd == recvFd) {
// New data to read.
::readData(recvFd);
} else if (status.fd == quitEvent) {
// Need quit.
::std::cout << "Quit event received." << ::std::endl;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment