Guest User

Untitled

a guest
Mar 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. '''
  2. 测试环境:
  3. python3.6
  4. pyzmq==17.0.0
  5. '''
  6. import time
  7. import zmq
  8. context = zmq.Context()
  9. socket = context.socket(zmq.PUB)
  10. socket.bind('tcp://127.0.0.1:2000')
  11.  
  12. # Allow clients to connect before sending data
  13.  
  14. for i in range(1,100):
  15. socket.send_pyobj({i:[1,2,3]})
  16. time.sleep(1)
Add Comment
Please, Sign In to add comment