15 lines
282 B
Python
15 lines
282 B
Python
#!/usr/bin/env python3
|
|
import zmq
|
|
|
|
|
|
context = zmq.Context()
|
|
socket = context.socket(zmq.PUB)
|
|
socket.bind("tcp://127.0.0.1:5559")
|
|
|
|
n = 10
|
|
msg_body = "\"" + "a" * n + "\""
|
|
try:
|
|
while True:
|
|
socket.send_string(f"test {msg_body}")
|
|
except KeyboardInterrupt:
|
|
socket.close() |