There is a server, that collects some data and then sends it to the client. I need to be sure that the client got the data sent by server. I thought PUB/SUB pattern here would be best choice, but I don't understand how to make check if client got the data? I heard something about reliable PUB/SUB, but there's no real example.
Any thought, suggestions, examples and help?
Simple publisher:
import zmq
context = zmq.Context()
server_socket = context.socket(zmq.PUB)
server_socket.bind('tcp://*:5559')
while True:
server_socket.send('message')
Simple subscriber:
import zmq
context = zmq.Context()
client_socket = context.socket(zmq.SUB)
client_socket.setsockopt(zmq.SUBSCRIBE, '')
client_socket.connect('tcp://localhost:5559')
while True:
print client_socket.recv()
In this example i need to be shure that subscriber got 'message'.