keepsimple1 / mdns-sd

Rust library for mDNS based Service Discovery
Apache License 2.0
96 stars 37 forks source link

use local UDP socket to signal the daemon #125

Closed keepsimple1 closed 1 year ago

keepsimple1 commented 1 year ago

This is to address issue #124 . The idea has two-folds:

  1. For client side commands sent into the flume channel, we use a socket to trigger an event. (Unfortunately flume channel itself does not implement AsRawFd trait and does not support polling event together with existing mDNS UDP sockets.

  2. For other timing based tasks, we store a simple u64 time for triggering them and uses timeouts to wait on them together with the sockets.

After this change, everything in the daemon run loop will be event driven (i.e. reactive) and have reduced latency.