Sleep should be used for testing only. The reason is that in real world scenario you don't know when the server will be up and when the client will try to connect, so client will miss all messages sent before it was up.
Pub-Sub out of the box is unreliable communication, like radio, if you just turn on the radio you are hearing what is live now, but missed everything before.
So as I see it there are two solutions to the pub-sub reliability problem, the first is the Clone pattern from the zeromq guide, read about it it will probably solve your problem.
The Clone problem is good when you are sending state update, but if you need a solution for event updates this is what I use for CQRS/event sourcing system:
1. You need to have streams (topics), each stream should have a sequence number. I use the aggregate id as the stream name and the version of the aggregate as the sequence.
2. Before publishing save the events to a database, then publish. Save in bulk to improve performance.
3. Before subscribing make a query to the database to get all previous events (or last 100 or save the last event handled)
Anyway I only recommend this pattern if you really cannot use the clone pattern, clone is much simpler and I use it a lot.