mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-27 02:40:51 +01:00
potential solution to session close
This commit is contained in:
parent
23648cf8bd
commit
065aebeb76
@ -25,16 +25,12 @@ public class UnityPacketHandler extends PacketHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendToStream(byte[] buffer) {
|
public void sendToStream(byte[] buffer) {
|
||||||
synchronized (sendLock) {
|
// synchronized (session) {
|
||||||
try {
|
|
||||||
byte[] prefix = new byte[]{(direction == HMessage.Direction.TOCLIENT ? ((byte)0) : ((byte)1))};
|
byte[] prefix = new byte[]{(direction == HMessage.Direction.TOCLIENT ? ((byte)0) : ((byte)1))};
|
||||||
byte[] combined = ByteArrayUtils.combineByteArrays(prefix, buffer);
|
byte[] combined = ByteArrayUtils.combineByteArrays(prefix, buffer);
|
||||||
|
|
||||||
session.getBasicRemote().sendBinary(ByteBuffer.wrap(combined));
|
session.getAsyncRemote().sendBinary(ByteBuffer.wrap(combined));
|
||||||
} catch (IOException e) {
|
// }
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user