/** * Sends a ping to the client. * * @param buf * @throws IOException * @throws IllegalArgumentException */ public void sendPing(byte[] buf) throws IllegalArgumentException, IOException { if (log.isTraceEnabled()) { log.trace("send ping: {}", buf); } if (wsSession != null && isConnected()) { // send the bytes wsSession.getBasicRemote().sendPing(ByteBuffer.wrap(buf)); // update counter writtenBytes += buf.length; } }
/** * Sends a pong back to the client; normally in response to a ping. * * @param buf * @throws IOException * @throws IllegalArgumentException */ public void sendPong(byte[] buf) throws IllegalArgumentException, IOException { if (log.isTraceEnabled()) { log.trace("send pong: {}", buf); } if (wsSession != null && isConnected()) { // send the bytes wsSession.getBasicRemote().sendPong(ByteBuffer.wrap(buf)); // update counter writtenBytes += buf.length; } }
wsSession.getBasicRemote().sendBinary(ByteBuffer.wrap(buf));
sendFuture.get(20000L, TimeUnit.MILLISECONDS); } else { wsSession.getBasicRemote().sendText(output);
} else if (opCode == Constants.OPCODE_PING) { if (wsSession.isOpen()) { wsSession.getBasicRemote().sendPong(controlBufferBinary);
} else if (opCode == Constants.OPCODE_PING) { if (wsSession.isOpen()) { wsSession.getBasicRemote().sendPong(controlBufferBinary);
} else if (opCode == Constants.OPCODE_PING) { if (wsSession.isOpen()) { wsSession.getBasicRemote().sendPong(controlBufferBinary);
} else if (opCode == Constants.OPCODE_PING) { if (wsSession.isOpen()) { wsSession.getBasicRemote().sendPong(controlBufferBinary);
} else if (opCode == Constants.OPCODE_PING) { if (wsSession.isOpen()) { wsSession.getBasicRemote().sendPong(controlBufferBinary);