More robust shutdown sequence with warning on unclean shutdown.
This commit is contained in:
@@ -159,7 +159,9 @@ void TransportSender<MyState>::tick( void )
|
||||
template <class MyState>
|
||||
void TransportSender<MyState>::send_empty_ack( void )
|
||||
{
|
||||
assert ( timestamp() >= next_ack_time );
|
||||
uint64_t now = timestamp();
|
||||
|
||||
assert( now >= next_ack_time );
|
||||
|
||||
uint64_t new_num = sent_states.back().num + 1;
|
||||
|
||||
@@ -169,10 +171,10 @@ void TransportSender<MyState>::send_empty_ack( void )
|
||||
}
|
||||
|
||||
// sent_states.push_back( TimestampedState<MyState>( sent_states.back().timestamp, new_num, current_state ) );
|
||||
add_sent_state( sent_states.back().timestamp, new_num, current_state );
|
||||
add_sent_state( now, new_num, current_state );
|
||||
send_in_fragments( "", new_num );
|
||||
|
||||
next_ack_time = timestamp() + ACK_INTERVAL;
|
||||
next_ack_time = now + ACK_INTERVAL;
|
||||
next_send_time = uint64_t(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Network {
|
||||
static const int SEND_INTERVAL_MAX = 250; /* ms between frames */
|
||||
static const int ACK_INTERVAL = 3000; /* ms between empty acks */
|
||||
static const int ACK_DELAY = 100; /* ms before delayed ack */
|
||||
static const int SHUTDOWN_RETRIES = 3; /* number of shutdown packets to send before giving up */
|
||||
static const int SHUTDOWN_RETRIES = 16; /* number of shutdown packets to send before giving up */
|
||||
static const int ACTIVE_RETRY_TIMEOUT = 10000; /* attempt to resend at frame rate */
|
||||
|
||||
/* helper methods for tick() */
|
||||
|
||||
Reference in New Issue
Block a user