@Override public XnioIoThread getIoThread() { return channel.getIoThread(); }
@Override public XnioIoThread getIoThread() { return http2Channel.getIoThread(); }
@Override public void run() { sendGoAway(ERROR_NO_ERROR); //just to make sure the connection is actually closed we give it 2 seconds //then we forcibly kill the connection getIoThread().executeAfter(new Runnable() { @Override public void run() { IoUtils.safeClose(Http2Channel.this); } }, 2, TimeUnit.SECONDS); } });
@Override public void sendPing(PingListener listener, long timeout, TimeUnit timeUnit) { long count = PING_COUNTER.incrementAndGet(); byte[] data = new byte[8]; data[0] = (byte) count; data[1] = (byte)(count << 8); data[2] = (byte)(count << 16); data[3] = (byte)(count << 24); data[4] = (byte)(count << 32); data[5] = (byte)(count << 40); data[6] = (byte)(count << 48); data[7] = (byte)(count << 54); final PingKey key = new PingKey(data); outstandingPings.put(key, listener); if(timeout > 0) { http2Channel.getIoThread().executeAfter(() -> { PingListener listener1 = outstandingPings.remove(key); if(listener1 != null) { listener1.failed(UndertowMessages.MESSAGES.pingTimeout()); } }, timeout, timeUnit); } http2Channel.sendPing(data, (channel, exception) -> listener.failed(exception)); }
@Override public XnioIoThread getIoThread() { return channel.getIoThread(); }
@Override public XnioIoThread getIoThread() { return http2Channel.getIoThread(); }
@Override public XnioIoThread getIoThread() { return http2Channel.getIoThread(); }
@Override public XnioIoThread getIoThread() { return channel.getIoThread(); }
@Override public void run() { sendGoAway(ERROR_NO_ERROR); //just to make sure the connection is actually closed we give it 2 seconds //then we forcibly kill the connection getIoThread().executeAfter(new Runnable() { @Override public void run() { IoUtils.safeClose(Http2Channel.this); } }, 2, TimeUnit.SECONDS); } });
@Override public void run() { sendGoAway(ERROR_NO_ERROR); //just to make sure the connection is actually closed we give it 2 seconds //then we forcibly kill the connection getIoThread().executeAfter(new Runnable() { @Override public void run() { IoUtils.safeClose(Http2Channel.this); } }, 2, TimeUnit.SECONDS); } });
@Override public void sendPing(PingListener listener, long timeout, TimeUnit timeUnit) { long count = PING_COUNTER.incrementAndGet(); byte[] data = new byte[8]; data[0] = (byte) count; data[1] = (byte)(count << 8); data[2] = (byte)(count << 16); data[3] = (byte)(count << 24); data[4] = (byte)(count << 32); data[5] = (byte)(count << 40); data[6] = (byte)(count << 48); data[7] = (byte)(count << 54); final PingKey key = new PingKey(data); outstandingPings.put(key, listener); if(timeout > 0) { http2Channel.getIoThread().executeAfter(() -> { PingListener listener1 = outstandingPings.remove(key); if(listener1 != null) { listener1.failed(UndertowMessages.MESSAGES.pingTimeout()); } }, timeout, timeUnit); } http2Channel.sendPing(data, (channel, exception) -> listener.failed(exception)); }
@Override public void sendPing(PingListener listener, long timeout, TimeUnit timeUnit) { long count = PING_COUNTER.incrementAndGet(); byte[] data = new byte[8]; data[0] = (byte) count; data[1] = (byte)(count << 8); data[2] = (byte)(count << 16); data[3] = (byte)(count << 24); data[4] = (byte)(count << 32); data[5] = (byte)(count << 40); data[6] = (byte)(count << 48); data[7] = (byte)(count << 54); final PingKey key = new PingKey(data); outstandingPings.put(key, listener); if(timeout > 0) { http2Channel.getIoThread().executeAfter(() -> { PingListener listener1 = outstandingPings.remove(key); if(listener1 != null) { listener1.failed(UndertowMessages.MESSAGES.pingTimeout()); } }, timeout, timeUnit); } http2Channel.sendPing(data, (channel, exception) -> listener.failed(exception)); }