mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-16 20:39:15 +01:00
Only wait for 5 tries (15 seconds) for the bandwidth reply
This commit is contained in:
parent
de583835c3
commit
5275eda76b
@ -1147,8 +1147,10 @@ bool Network::ConnectToPeer()
|
|||||||
|
|
||||||
network_connection_error_t Network::WaitForBandWidthReply()
|
network_connection_error_t Network::WaitForBandWidthReply()
|
||||||
{
|
{
|
||||||
|
unsigned cnt;
|
||||||
|
|
||||||
/* Wait until we've got an ack */
|
/* Wait until we've got an ack */
|
||||||
while (1) {
|
for (cnt = 0; cnt < 5; cnt++) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
tv.tv_sec = 3;
|
tv.tv_sec = 3;
|
||||||
@ -1174,7 +1176,14 @@ network_connection_error_t Network::WaitForBandWidthReply()
|
|||||||
break;
|
break;
|
||||||
else /* Everything else is an error */
|
else /* Everything else is an error */
|
||||||
return SERVER_GARBAGE_ERROR;
|
return SERVER_GARBAGE_ERROR;
|
||||||
|
cnt++;
|
||||||
}
|
}
|
||||||
|
if (cnt == 5) {
|
||||||
|
printf("Timeout. Setting default kbps (160)\n");
|
||||||
|
this->target_kbps = 160000;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* We got a bandwidth ACK */
|
/* We got a bandwidth ACK */
|
||||||
|
|
||||||
uint32 now = SDL_GetTicks();
|
uint32 now = SDL_GetTicks();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user