s <- socket("bus", listen = "inproc://nanolock")
s1 <- socket("bus", dial = "inproc://nanolock")
lock(s)
s2 <- socket("bus", dial = "inproc://nanolock")
send(s, "test")
recv(s1)
recv(s2)
unlock(s)
s3 <- socket("bus", dial = "inproc://nanolock")
send(s, "test")
recv(s1)
recv(s3)
close(s)
close(s1)
close(s2)
close(s3)
Run the code above in your browser using DataLab