final Map<String, ALPNProtocol> protocolMap = new HashMap<>(); for (int i = 0; i < protocols.length; ++i) { protocols[i] = details[i].getProtocol(); protocolMap.put(details[i].getProtocol(), details[i]);
private void handleSelected(String selected) { if (selected.isEmpty()) { sslConnection.getSourceChannel().suspendReads(); fallback.handleEvent(sslConnection); return; } else { ALPNClientSelector.ALPNProtocol details = protocolMap.get(selected); if (details == null) { //should never happen sslConnection.getSourceChannel().suspendReads(); fallback.handleEvent(sslConnection); return; } else { sslConnection.getSourceChannel().suspendReads(); details.getSelected().handleEvent(sslConnection); } } } });
final Map<String, ALPNProtocol> protocolMap = new HashMap<>(); for (int i = 0; i < protocols.length; ++i) { protocols[i] = details[i].getProtocol(); protocolMap.put(details[i].getProtocol(), details[i]);
final Map<String, ALPNProtocol> protocolMap = new HashMap<>(); for (int i = 0; i < protocols.length; ++i) { protocols[i] = details[i].getProtocol(); protocolMap.put(details[i].getProtocol(), details[i]);
private void handleSelected(String selected) { if (selected.isEmpty()) { sslConnection.getSourceChannel().suspendReads(); fallback.handleEvent(sslConnection); return; } else { ALPNClientSelector.ALPNProtocol details = protocolMap.get(selected); if (details == null) { //should never happen sslConnection.getSourceChannel().suspendReads(); fallback.handleEvent(sslConnection); return; } else { sslConnection.getSourceChannel().suspendReads(); details.getSelected().handleEvent(sslConnection); } } } });
private void handleSelected(String selected) { if (selected.isEmpty()) { sslConnection.getSourceChannel().suspendReads(); fallback.handleEvent(sslConnection); return; } else { ALPNClientSelector.ALPNProtocol details = protocolMap.get(selected); if (details == null) { //should never happen sslConnection.getSourceChannel().suspendReads(); fallback.handleEvent(sslConnection); return; } else { sslConnection.getSourceChannel().suspendReads(); details.getSelected().handleEvent(sslConnection); } } } });
public static ALPNClientSelector.ALPNProtocol alpnProtocol(final ClientCallback<ClientConnection> listener, URI uri, ByteBufferPool bufferPool, OptionMap options) { return new ALPNClientSelector.ALPNProtocol(new ChannelListener<SslConnection>() { @Override public void handleEvent(SslConnection connection) { listener.completed(createHttp2Channel(connection, bufferPool, options, uri.getHost())); } }, HTTP2); };
public static ALPNClientSelector.ALPNProtocol alpnProtocol(final ClientCallback<ClientConnection> listener, URI uri, ByteBufferPool bufferPool, OptionMap options) { return new ALPNClientSelector.ALPNProtocol(new ChannelListener<SslConnection>() { @Override public void handleEvent(SslConnection connection) { listener.completed(createHttp2Channel(connection, bufferPool, options, uri.getHost())); } }, HTTP2); };
public static ALPNClientSelector.ALPNProtocol alpnProtocol(final ClientCallback<ClientConnection> listener, URI uri, ByteBufferPool bufferPool, OptionMap options) { return new ALPNClientSelector.ALPNProtocol(new ChannelListener<SslConnection>() { @Override public void handleEvent(SslConnection connection) { listener.completed(createHttp2Channel(connection, bufferPool, options, uri.getHost())); } }, HTTP2); };