erickt / rust-zmq

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

Expose zmq_setsockopt publicly #342

Open grahamjameson opened 2 years ago

grahamjameson commented 2 years ago

A diff for such a change might look like:

**diff --git a/src/lib.rs b/src/lib.rs
index c8c2b91..60468c8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -31,7 +31,7 @@ macro_rules! zmq_try {
 }

 mod message;
-mod sockopt;
+pub mod sockopt;

 use crate::message::msg_ptr;
 pub use crate::message::Message;**

I would be happy to open a PR given feedback from maintainers about how they would like the change to be made so that it is most likely to be merged.

andrewdavidmackenzie commented 1 year ago

+1

I want to set SO_REUSEADDR on a socket, and I cannot find a way to do so (from rust) currently, and I understand this is the method I would require. I see some macros in the code but cannot find docs on them...

grahamjameson commented 1 year ago

@andrewdavidmackenzie hopefully you already figured this out, but you can work around this by separately using the zmq_sys crate that exists within this one.

andrewdavidmackenzie commented 9 months ago

Was wondering if you thought this would get exposed in zmq (rust), or zmq_sys will be the only way and no point in waiting?

grahamjameson commented 7 months ago

@andrewdavidmackenzie It seems this project is no longer maintained. My personal recommendation would be to use zmq_sys, as that will be less work than forking.