potential solution to session close

This commit is contained in:
sirjonasxx 2020-12-28 17:46:42 +01:00
parent 23648cf8bd
commit 065aebeb76

View File

@ -25,16 +25,12 @@ public class UnityPacketHandler extends PacketHandler {
@Override
public void sendToStream(byte[] buffer) {
synchronized (sendLock) {
try {
// synchronized (session) {
byte[] prefix = new byte[]{(direction == HMessage.Direction.TOCLIENT ? ((byte)0) : ((byte)1))};
byte[] combined = ByteArrayUtils.combineByteArrays(prefix, buffer);
session.getBasicRemote().sendBinary(ByteBuffer.wrap(combined));
} catch (IOException e) {
e.printStackTrace();
}
}
session.getAsyncRemote().sendBinary(ByteBuffer.wrap(combined));
// }
}
@Override