<s> import zmq <EOL> import uuid <EOL> address = "<STR_LIT>" <EOL> c = zmq . Context ( ) <EOL> s1 = c . socket ( zmq . DEALER ) <EOL> s2 = c . socket ( zmq . DEALER ) <EOL> s3 = c . socket ( zmq . DEALER ) <EOL> d1 = uuid . uuid4 ( ) . hex . encode ( "<STR_LIT:utf-8>" ) <EOL> d2 = uuid . uuid4 ( ) . hex . encode ( "<STR_LIT:utf-8>" ) <EOL> d3 = uuid . uuid4 ( ) . hex . encode ( "<STR_LIT:utf-8>" ) <EOL> print ( "<STR_LIT>" , address ) <EOL> s2 . bind ( address ) <EOL> print ( "<STR_LIT>" , address ) <EOL> s1 . connect ( address ) <EOL> s3 . connect ( address ) <EOL> print ( "<STR_LIT>" % d1 ) <EOL> s1 . send ( d1 ) <EOL> print ( "<STR_LIT>" % d3 ) <EOL> s3 . send ( d3 ) <EOL> print ( "<STR_LIT>" ) <EOL> data1 = s2 . recv ( ) <EOL> print ( data1 ) <EOL> assert data1 == d1 <EOL> data3 = s2 . recv ( ) <EOL> print ( data3 ) <EOL> assert data3 == d3 <EOL> print ( "<STR_LIT>" % d2 ) <EOL> s1 . send ( d2 ) <EOL> print ( "<STR_LIT>" ) <EOL> data2 = s2 . recv ( ) <EOL> print ( data2 ) <EOL> assert data2 == d2 <EOL> print ( "<STR_LIT>" % data1 ) <EOL> s2 . send ( data1 ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( s1 . recv ( ) ) <EOL> print ( "<STR_LIT>" % data2 ) <EOL> s2 . send ( data2 ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( s1 . recv ( ) ) </s>
