Handle timeouts

These can happen when we're sending data over TCP and are waiting for the server to acknowledge, but the acknowledgement gets lost somewhere.
    
We need to reconnect after we've timed out in order to flush delayed responses.