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