1
我正在嘗試寫一個測量員響應者模式。但它拋出的錯誤:測量員被調查者在nanomsg中的模式python
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()
我怎樣才能在Python中實現這種模式?