[zeromq-dev] Event on unplugged cable

Michael Haberler mail17 at mah.priv.at
Wed May 20 11:54:00 CEST 2015


> Am 20.05.2015 um 11:35 schrieb Leonard Michelet <leonard.michelet at openwide.fr>:
> 
> Hi, I'm on Linux, and when i (un)plug an ethernet cable, dmesg show me event such as
> [ 4268.169999] xxx 0000:01:00.0: eth0: link down
> [ 4274.029239] xxx 0000:01:00.0: eth0: link up
> 
> And I would like to receive these event in my c++ program.
> Do anyone know a way to get these event using a c/c++ API, or even better, a way to get it using zmq?
> I know something like that exist in NetMQ, but since it's only on windows, there must be less portability issues.

you might want to investigate the hotlpug subsystem - maybe a udev rule which starts a program on plug/unplug and that would inject zmq messages as needed

if you want to get really fancy you might directly interact with netlink sockets, on which udev is based, but I doubt this is worth the effort 

- Michael

> 
> Thank you for your help.
> 
> 
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev




More information about the zeromq-dev mailing list