mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Merge pull request #4682 from delftswa2018/hotfix/resolving-unaccepted-changes
Hotfix - resolving unaccepted changes
This commit is contained in:
commit
8563c6d865
3 changed files with 5 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package org.mage.card.arcane;
|
||||
|
||||
import mage.util.StreamUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramPacket;
|
||||
import java.net.DatagramSocket;
|
||||
|
|
@ -42,7 +44,7 @@ public final class Util {
|
|||
socket = new DatagramSocket();
|
||||
broadcast(socket, data, port, NetworkInterface.getNetworkInterfaces());
|
||||
} finally {
|
||||
socket.close();
|
||||
StreamUtils.closeQuietly(socket);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ public class ChatSession {
|
|||
String userName = clients.get(userId);
|
||||
if (reason != DisconnectReason.LostConnection) { // for lost connection the user will be reconnected or session expire so no removeUserFromAllTablesAndChat of chat yet
|
||||
final Lock w = lock.writeLock();
|
||||
w.lock();
|
||||
try {
|
||||
w.lock();
|
||||
clients.remove(userId);
|
||||
} finally {
|
||||
w.unlock();
|
||||
|
|
|
|||
|
|
@ -231,8 +231,8 @@ public enum UserManager {
|
|||
}
|
||||
logger.debug("Users to remove " + toRemove.size());
|
||||
final Lock w = lock.readLock();
|
||||
w.lock();
|
||||
try {
|
||||
w.lock();
|
||||
for (User user : toRemove) {
|
||||
users.remove(user.getId());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue