ZeroMQ in R how to close a socket
how can i close open zmq socket in R?
port = 1111
zmq_context <- init.context()
zmq_service.socket <- init.socket(zmq_context,"ZMQ_REQ")
connect.socket(zmq_service.socket, paste("tcp://127.0.0.1:", port, sep = ""))
As I see it, I can just delete the object and expect the garbage collector to lose it.
rm(zmq_service.socket, zmq_context)
+3
source to share
1 answer
It has been fixed by the developer. See the gihub issue .
disconnect.socket <- function(socket, address) {
invisible(.Call("disconnectSocket", socket, address, PACKAGE="rzmq"))
}
0
source to share