(notonline)-->
without js -- (zmq dll/so)
puts(1, "durapub:\n")
include zmq/zmq.e
atom context = zmq_init(1)
zmq_assert(context, "zmq_init")
--// subscriber tells us when it's ready here
atom sync = zmq_socket(context, ZMQ_PULL)
zmq_bind(sync, "tcp://*:5564")
--// send update via this socket
atom publisher = zmq_socket(context, ZMQ_PUB)
zmq_bind(publisher, "tcp://*:5565")
--// broadcast 10 updates, with pause
for update_nbr = 1 to 10 do
string s = sprintf("Update %d", { update_nbr })
zmq_s_send(publisher, s)
sleep(1)
end for
zmq_s_send(publisher, "END")
sleep(1)
zmq_close(sync)
zmq_close(publisher)
zmq_term(context)