mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
X
This commit is contained in:
parent
ea5269ed59
commit
db1fe40f90
@ -111,8 +111,11 @@ namespace MCGalaxy.Network {
|
||||
}
|
||||
|
||||
lock (sendLock) {
|
||||
if (sendInProgress) { sendQueue.Enqueue(buffer); }
|
||||
else { DoSendAsync(buffer); }
|
||||
if (sendInProgress) {
|
||||
sendQueue.Enqueue(buffer);
|
||||
} else {
|
||||
if (!DoSendAsync(buffer)) sendInProgress = false;
|
||||
}
|
||||
}
|
||||
} catch (SocketException) {
|
||||
player.Disconnect();
|
||||
@ -152,6 +155,8 @@ namespace MCGalaxy.Network {
|
||||
// DoSendAsync returns false if SendAsync completed sync
|
||||
// If that happens, SendCallback isn't called so we need to send data here instead
|
||||
if (s.DoSendAsync(s.sendQueue.Dequeue())) return;
|
||||
|
||||
if (s.player.disconnected) s.sendQueue.Clear();
|
||||
}
|
||||
}
|
||||
} catch (SocketException) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user