This commit is contained in:
@@ -143,13 +143,14 @@ public class WebSocketRunner implements Runnable {
|
|||||||
public void sendMessage(WebSocketPacket packet) {
|
public void sendMessage(WebSocketPacket packet) {
|
||||||
if (packet == null || closed) return;
|
if (packet == null || closed) return;
|
||||||
|
|
||||||
|
final boolean debug = this.coder.debugable;
|
||||||
//System.out.println("推送消息");
|
//System.out.println("推送消息");
|
||||||
final byte[] bytes = coder.encode(packet);
|
final byte[] bytes = coder.encode(packet);
|
||||||
|
if (debug) context.getLogger().log(Level.FINEST, "send web socket message's length = " + bytes.length);
|
||||||
if (writing.getAndSet(true)) {
|
if (writing.getAndSet(true)) {
|
||||||
queue.add(bytes);
|
queue.add(bytes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final boolean debug = this.coder.debugable;
|
|
||||||
if (writeBuffer == null) return;
|
if (writeBuffer == null) return;
|
||||||
ByteBuffer sendBuffer = null;
|
ByteBuffer sendBuffer = null;
|
||||||
if (bytes.length <= writeBuffer.capacity()) {
|
if (bytes.length <= writeBuffer.capacity()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user