My best guess is that you haven't properly configured TCP keepalives. Not sure if the REST client enables them by default but you can set them in the httpClientConfigCallback if not. You'll also need to tell your OS to send the first keepalive after less than 30 minutes -- the default is over 2 hours.
If you're on Linux you should also probably set the TCP retransmission timeout to something more sensible than the default of 15 minutes.