Skip to content

Commit

Permalink
netlink: improved event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmm committed Sep 10, 2024
1 parent 492daf4 commit a39e0b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/netlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ Netlink::~Netlink() {
}

void Netlink::connect() {
nl_socket = socket(PF_NETLINK, SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC, NETLINK_CONNECTOR);
// SOCK_NONBLOCK makes the cpu cores usage to be very high because the loop iterates too often

nl_socket = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_CONNECTOR);

if (nl_socket == -1) {
listen = false;
Expand Down

0 comments on commit a39e0b7

Please sign in to comment.