mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-16 17:59:19 +01:00
Increase the sleep duration if no client is connected.
This commit is contained in:
parent
48eac1549e
commit
258e93d01e
@ -42,6 +42,5 @@ BOOL BackgroundThread::whileLoop() {
|
||||
OSSleepTicks(OSSecondsToTicks(5));
|
||||
}
|
||||
}
|
||||
OSSleepTicks(OSMillisecondsToTicks(1));
|
||||
return true;
|
||||
}
|
||||
|
@ -958,9 +958,11 @@ recv_loop_end:
|
||||
bool process_ftp_events(int32_t server) {
|
||||
bool network_down = !process_accept_events(server);
|
||||
int client_index;
|
||||
bool hasActiveClients = false;
|
||||
for (client_index = 0; client_index < MAX_CLIENTS; client_index++) {
|
||||
client_t *client = clients[client_index];
|
||||
if (client) {
|
||||
hasActiveClients = true;
|
||||
if (client->data_callback) {
|
||||
process_data_events(client);
|
||||
} else {
|
||||
@ -968,5 +970,10 @@ bool process_ftp_events(int32_t server) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasActiveClients) {
|
||||
OSSleepTicks(OSMillisecondsToTicks(100));
|
||||
} else {
|
||||
OSSleepTicks(OSMillisecondsToTicks(1));
|
||||
}
|
||||
return network_down;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user