转至ZMQ4-关闭Recv上阻止的套接字?

I am using this library: https://github.com/pebbe/zmq4 for Go bindings of ZeroMQ.

My question is, how do I safely close a socket that's waiting for a message? I was thinking of creating a new context for every socket and then I could just terminate the context.

But the pebbe/zmq4 library doesn't allow me to create a new context (or so it seems to me).

Thanks for helping.

I am going with a simple yet effective suggestion from one of my professors.

While closing, I send a unique termination code to the socket and wait till the socket reads it and closes itself.