surveyor respondent pattern in nanomsg in python -


i trying write surveyor respondent pattern. throws error:

nanomsg.nanomsgapierror: operation cannot performed in state

from nanomsg import *  s1 = socket(surveyor) s1.bind('ipc://bob') s1.send(b'hello nanomsg') print(s1.recv()) s1.close()  nanomsg import *  s2 = socket(respondent) s2.connect('ipc://bob') print(s2.recv()) s2.send(b'hello') s2.close() 

how can implement pattern in python?

its bug, can circumvented inserting "time.sleep(0.1)", after bind or connect statement.

from nanomsg import * import time   s1 = socket(surveyor) s1.bind('ipc://bob.ipc') time.sleep(0.1) s1.send(b'hello nanomsg') print(s1.recv()) s1.close() 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -