Closed divyekapoor closed 1 year ago
Don't share ZeroMQ sockets between threads. ZeroMQ sockets are not threadsafe. Technically it's possible to migrate a socket from one thread to another but it demands skill. The only place where it's remotely sane to share sockets between threads are in language bindings that need to do magic like garbage collection on sockets.
Reference: https://zguide.zeromq.org/docs/chapter2/
Without this change, trying to access a Socket in a global / static variable does not work even if a single thread is actually accessing the socket.
*mut c_void
cannot be shared between threads safely --> src/lib.rs:49:30*mut c_void
cannot be shared between threads safely= help: within
(NettleHandle, NettleOperator)
, the traitSync
is not implemented for*mut c_void
= note: required because it appears within the typeSocket
note: required because it appears within the typeNettleOperator
--> src/lib.rs:23:8