All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.firefly.net.tcp.secure.jdk.EmptyALPNSelector Maven / Gradle / Ivy

There is a newer version: 5.0.0-dev6
Show newest version
package com.firefly.net.tcp.secure.jdk;

import com.firefly.net.ApplicationProtocolSelector;

import javax.net.ssl.SSLEngine;
import java.util.Collections;
import java.util.List;

/**
 * @author Pengtao Qiu
 */
public class EmptyALPNSelector implements ApplicationProtocolSelector {

    private final List supportedProtocols;
    private volatile String applicationProtocol;

    public EmptyALPNSelector(SSLEngine sslEngine, List supportedProtocols) {
        this.supportedProtocols = Collections.singletonList("http/1.1");
        this.applicationProtocol = this.supportedProtocols.get(0);
    }

    @Override
    public String getApplicationProtocol() {
        return applicationProtocol;
    }

    @Override
    public List getSupportedApplicationProtocols() {
        return supportedProtocols;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy