force disconnects after a couple of failed tries when shutting the server down
This commit is contained in:
parent
e3fcf07382
commit
9fb2a4bf41
1 changed files with 8 additions and 1 deletions
|
@ -593,8 +593,15 @@ bool disconnect(connection s, bool force)
|
|||
if(s == 0) {
|
||||
while(sockets.empty() == false) {
|
||||
assert(sockets.back() != 0);
|
||||
// disconnect(sockets.back(), true);
|
||||
size_t n = 0;
|
||||
while(disconnect(sockets.back()) == false) {
|
||||
// force a disconnect
|
||||
if (n > 100) {
|
||||
disconnect(sockets.back(), true);
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
++n;
|
||||
SDL_Delay(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue