Closed najamelan closed 5 years ago
NngSocket has a Arc<InnerSocket>
with impl Drop
. I should document that somewhere.
Thanks for these suggestions, it's very helpful to get a second opinion.
Ok, so I can do pair1.socket()
to obtain NngSocket
, but then how do I make it drop?
You're most welcome for the feedback. Thanks for writing this. IPC isn't trivial right now in rust. And yeah, zeromq seems to be a bit dated.
I see that structs like
protocol::pair1::Pair1
have methods likedial
andlisten
, but notclose
?I wondered about this after running into this problem. Messages get dropped because the sender shuts down before they have finished sending. I wasn't using threads, but when sleeping 500ms before shutting the program down I can't reproduce the problem anymore, so I suppose it's what happens.
I wondered if a
close
method could flush the connection and then disconnect? And if that could prevent problems like this.