I am trying to write a surveyor respondent pattern. But it throws the error:
nanomsg.NanoMsgAPIError: Operation cannot be performed in this state
from nanomsg import *
s1 = Socket(SURVEYOR)
s1.bind('ipc://bob')
s1.send(b'hello nanomsg')
print(s1.recv())
s1.close()
from nanomsg import *
s2 = Socket(RESPONDENT)
s2.connect('ipc://bob')
print(s2.recv())
s2.send(b'Hello')
s2.close()
How can I implement this pattern in python?