Isn't this something tcp itself does? So any protocol on top of tcp would inherit the same.
If the client goes offline for longer durations, they should attempt to reconnect after coming online.
See this comment that someone posted here today:
https://news.ycombinator.com/item?id=29653600