MCPcopy Create free account
hub / github.com/Alexays/Waybar / createInfoSocket

Method createInfoSocket

src/modules/network.cpp:192–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void waybar::modules::Network::createInfoSocket() {
193 sock_ = nl_socket_alloc();
194 if (genl_connect(sock_) != 0) {
195 throw std::runtime_error("Can't connect to netlink socket");
196 }
197 if (nl_socket_modify_cb(sock_, NL_CB_VALID, NL_CB_CUSTOM, handleScan, this) < 0) {
198 throw std::runtime_error("Can't set callback");
199 }
200 nl80211_id_ = genl_ctrl_resolve(sock_, "nl80211");
201 if (nl80211_id_ < 0) {
202 spdlog::warn("Can't resolve nl80211 interface");
203 }
204}
205
206void waybar::modules::Network::worker() {
207 // update via here not working

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected