Remove automatic hopping triggers from SSP.
This commit is contained in:
@@ -117,7 +117,6 @@ void Connection::reset( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
last_association = timestamp();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,8 +157,6 @@ Connection::Connection( const char *desired_ip, const char *desired_port ) /* se
|
|||||||
saved_timestamp( -1 ),
|
saved_timestamp( -1 ),
|
||||||
saved_timestamp_received_at( 0 ),
|
saved_timestamp_received_at( 0 ),
|
||||||
expected_receiver_seq( 0 ),
|
expected_receiver_seq( 0 ),
|
||||||
last_heard( -1 ),
|
|
||||||
last_association( -1 ),
|
|
||||||
RTT_hit( false ),
|
RTT_hit( false ),
|
||||||
SRTT( 1000 ),
|
SRTT( 1000 ),
|
||||||
RTTVAR( 500 ),
|
RTTVAR( 500 ),
|
||||||
@@ -269,8 +266,6 @@ Connection::Connection( const char *key_str, const char *ip, int port ) /* clien
|
|||||||
saved_timestamp( -1 ),
|
saved_timestamp( -1 ),
|
||||||
saved_timestamp_received_at( 0 ),
|
saved_timestamp_received_at( 0 ),
|
||||||
expected_receiver_seq( 0 ),
|
expected_receiver_seq( 0 ),
|
||||||
last_heard( -1 ),
|
|
||||||
last_association( -1 ),
|
|
||||||
RTT_hit( false ),
|
RTT_hit( false ),
|
||||||
SRTT( 1000 ),
|
SRTT( 1000 ),
|
||||||
RTTVAR( 500 ),
|
RTTVAR( 500 ),
|
||||||
@@ -290,7 +285,6 @@ Connection::Connection( const char *key_str, const char *ip, int port ) /* clien
|
|||||||
}
|
}
|
||||||
|
|
||||||
has_remote_addr = true;
|
has_remote_addr = true;
|
||||||
last_association = timestamp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Connection::send( string s )
|
void Connection::send( string s )
|
||||||
@@ -313,13 +307,6 @@ void Connection::send( string s )
|
|||||||
have_send_exception = true;
|
have_send_exception = true;
|
||||||
send_exception = NetworkException( "sendto", errno );
|
send_exception = NetworkException( "sendto", errno );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* association timeout */
|
|
||||||
uint64_t now = timestamp();
|
|
||||||
if ( ( now - last_association > ASSOCIATION_TIMEOUT )
|
|
||||||
&& ( now - last_heard > ASSOCIATION_TIMEOUT ) ) {
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string Connection::recv( void )
|
string Connection::recv( void )
|
||||||
@@ -360,8 +347,6 @@ string Connection::recv( void )
|
|||||||
uint16_t now = timestamp16();
|
uint16_t now = timestamp16();
|
||||||
double R = timestamp_diff( now, p.timestamp_reply );
|
double R = timestamp_diff( now, p.timestamp_reply );
|
||||||
|
|
||||||
last_heard = timestamp(); /* trigger on end-to-end-to-end connectivity */
|
|
||||||
|
|
||||||
if ( R < 5000 ) { /* ignore large values, e.g. server was Ctrl-Zed */
|
if ( R < 5000 ) { /* ignore large values, e.g. server was Ctrl-Zed */
|
||||||
if ( !RTT_hit ) { /* first measurement */
|
if ( !RTT_hit ) { /* first measurement */
|
||||||
SRTT = R;
|
SRTT = R;
|
||||||
@@ -379,7 +364,6 @@ string Connection::recv( void )
|
|||||||
|
|
||||||
/* auto-adjust to remote host */
|
/* auto-adjust to remote host */
|
||||||
has_remote_addr = true;
|
has_remote_addr = true;
|
||||||
last_association = timestamp();
|
|
||||||
|
|
||||||
if ( server ) { /* only client can roam */
|
if ( server ) { /* only client can roam */
|
||||||
if ( (remote_addr.sin_addr.s_addr != packet_remote_addr.sin_addr.s_addr)
|
if ( (remote_addr.sin_addr.s_addr != packet_remote_addr.sin_addr.s_addr)
|
||||||
|
|||||||
@@ -91,8 +91,6 @@ namespace Network {
|
|||||||
static const int PORT_RANGE_LOW = 60001;
|
static const int PORT_RANGE_LOW = 60001;
|
||||||
static const int PORT_RANGE_HIGH = 60999;
|
static const int PORT_RANGE_HIGH = 60999;
|
||||||
|
|
||||||
static const unsigned int ASSOCIATION_TIMEOUT = 20000; /* ms */
|
|
||||||
|
|
||||||
static bool try_bind( int socket, uint32_t addr, int port );
|
static bool try_bind( int socket, uint32_t addr, int port );
|
||||||
|
|
||||||
int sock;
|
int sock;
|
||||||
@@ -114,8 +112,6 @@ namespace Network {
|
|||||||
uint64_t saved_timestamp_received_at;
|
uint64_t saved_timestamp_received_at;
|
||||||
uint64_t expected_receiver_seq;
|
uint64_t expected_receiver_seq;
|
||||||
|
|
||||||
uint64_t last_heard, last_association;
|
|
||||||
|
|
||||||
bool RTT_hit;
|
bool RTT_hit;
|
||||||
double SRTT;
|
double SRTT;
|
||||||
double RTTVAR;
|
double RTTVAR;
|
||||||
@@ -127,8 +123,6 @@ namespace Network {
|
|||||||
|
|
||||||
Packet new_packet( string &s_payload );
|
Packet new_packet( string &s_payload );
|
||||||
|
|
||||||
void reset( void );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Connection( const char *desired_ip, const char *desired_port ); /* server */
|
Connection( const char *desired_ip, const char *desired_port ); /* server */
|
||||||
Connection( const char *key_str, const char *ip, int port ); /* client */
|
Connection( const char *key_str, const char *ip, int port ); /* client */
|
||||||
@@ -152,6 +146,8 @@ namespace Network {
|
|||||||
{
|
{
|
||||||
return have_send_exception ? &send_exception : NULL;
|
return have_send_exception ? &send_exception : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset( void );
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user