You can make alive connections and you don't need to use alive packets between server and client for TCP connections. If connection is dropped, both side will.
If I understand right, you can easily check if the connection is dropped in packet recieving function. Just import a feature that reconnects if disconnected.
But if the connection is dropped before server publishes new "event" and reconnects after that, client cannot recieve this packet.
If you pass over this problem, try this:
- Save your events in a list.
- Add a timestamp property to every event.
- Be sure that client can remember the timestamp value of the last event it received.
- Make the client to send a request that includes the timestamp value of the last event for missing events after reconnection.
- If server receives this request, make it to send events which timestamps are greater than LastTimeStamp argument in the request packet.