Put horrible packet loss back in
This commit is contained in:
@@ -161,11 +161,9 @@ void Connection::send( string &s, bool send_timestamp )
|
|||||||
string p = px.tostring( &session );
|
string p = px.tostring( &session );
|
||||||
|
|
||||||
/* XXX synthetic packet loss */
|
/* XXX synthetic packet loss */
|
||||||
/*
|
|
||||||
if ( rand() < RAND_MAX / 2 ) {
|
if ( rand() < RAND_MAX / 2 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
ssize_t bytes_sent = sendto( sock, p.data(), p.size(), 0,
|
ssize_t bytes_sent = sendto( sock, p.data(), p.size(), 0,
|
||||||
(sockaddr *)&remote_addr, sizeof( remote_addr ) );
|
(sockaddr *)&remote_addr, sizeof( remote_addr ) );
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ void Transport<MyState, RemoteState>::send_to_receiver( void )
|
|||||||
string s = inst.tostring();
|
string s = inst.tostring();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fprintf( stderr, "Sent instruction (timeout %d) from %d => %d (terminal %d): %s\r\n", connection.timeout(), int(inst.old_num), int(inst.new_num), int(sent_states.back().num), inst.diff.c_str() );
|
fprintf( stderr, "Sent instruction (timeout %d, queues %d/%d) from %d => %d (terminal %d): %s\r\n", connection.timeout(), (int)sent_states.size(), (int)received_states.size(), int(inst.old_num), int(inst.new_num), int(sent_states.back().num), inst.diff.c_str() );
|
||||||
connection.send( s );
|
connection.send( s );
|
||||||
} catch ( MTUException m ) {
|
} catch ( MTUException m ) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user