erickt / rust-zmq

Rust zeromq bindings.
Apache License 2.0
887 stars 189 forks source link

Monitor event 4096 is unknown #256

Closed normano closed 5 years ago

normano commented 5 years ago

I was running the zguide/monitor example and ran into this

thread 'main' panicked at 'unknown event type 4096', /..../etc./../zmq-0.9.0/src/lib.rs:106:18 stack backtrace:

Around that line is this: event = get_monitor_event(&mut client_mon).unwrap(); assert_eq!(zmq::SocketEvent::MONITOR_STOPPED, event); println!("got client monitor event {:?}", event);

normano commented 5 years ago

@erickt It is weird that MONITOR_STOPPED is the only affected

normano commented 5 years ago

Looked more into this and there is a bug somewhere. Can't say it is libzmq's fault or this lib though. I commented out bounce and the panic goes away after commenting out assertions.

normano commented 5 years ago

Gonna close here since C++ code produces same result.

normano commented 5 years ago

Actually, 0x1000 is expected and this lib does not have enum for it. Test has the workflow: https://github.com/zeromq/libzmq/blob/25bb43c33ad158a337ed349073f0a5deb74152c1/tests/test_monitor.cpp

I'll fix for my use, but considering lack of activity from author I will not submit PR.

normano commented 5 years ago

Already went off and forked and change some things for my liking. Another PR has the socket fix, but the example also needs to be fixed. I will submit fix for libzmq and hope this lib will follow.