private void sendHeartbeat ( WebSocket websocket ) { ObjectNode heartbeatPacket = JsonNodeFactory . instance . objectNode ( ) ; heartbeatPacket . put ( "op" , GatewayOpcode . HEARTBEAT . getCode ( ) ) ; heartbeatPacket . put ( "d" , lastSeq ) ; WebSocketFrame heartbeatFrame = WebSocketFrame . createTextFrame ( heartbeatPacket . toString ( ) ) ; nextHeartbeatFrame . set ( heartbeatFrame ) ; websocket . sendFrame ( heartbeatFrame ) ; }
Sends the heartbeat .