Home / Class/ SpdyServer Class — netty Architecture

SpdyServer Class — netty Architecture

Architecture documentation for the SpdyServer class in SpdyServer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d5aca0fd_5a57_358b_62e5_cf1a2057efce["SpdyServer"]
  8dd66d73_cd20_144d_15b2_00d1a648920f["SpdyServer.java"]
  d5aca0fd_5a57_358b_62e5_cf1a2057efce -->|defined in| 8dd66d73_cd20_144d_15b2_00d1a648920f
  4d96ea7a_0546_7c23_bb68_ce4c7db36e49["main()"]
  d5aca0fd_5a57_358b_62e5_cf1a2057efce -->|method| 4d96ea7a_0546_7c23_bb68_ce4c7db36e49

Relationship Graph

Source Code

example/src/main/java/io/netty/example/spdy/server/SpdyServer.java lines 49–90

public final class SpdyServer {

    static final int PORT = Integer.parseInt(System.getProperty("port", "8443"));

    public static void main(String[] args) throws Exception {
        // Configure SSL.
        X509Bundle ssc = new CertificateBuilder()
                .subject("cn=localhost")
                .setIsCertificateAuthority(true)
                .buildSelfSigned();
        SslContext sslCtx = SslContextBuilder.forServer(ssc.toKeyManagerFactory())
            .applicationProtocolConfig(new ApplicationProtocolConfig(
                        Protocol.ALPN,
                        // NO_ADVERTISE is currently the only mode supported by both OpenSsl and JDK providers.
                        SelectorFailureBehavior.NO_ADVERTISE,
                        // ACCEPT is currently the only mode supported by both OpenSsl and JDK providers.
                        SelectedListenerFailureBehavior.ACCEPT,
                        ApplicationProtocolNames.SPDY_3_1,
                        ApplicationProtocolNames.HTTP_1_1))
            .build();

        // Configure the server.
        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            ServerBootstrap b = new ServerBootstrap();
            b.option(ChannelOption.SO_BACKLOG, 1024);
            b.group(group)
             .channel(NioServerSocketChannel.class)
             .handler(new LoggingHandler(LogLevel.INFO))
             .childHandler(new SpdyServerInitializer(sslCtx));

            Channel ch = b.bind(PORT).sync().channel();

            System.err.println("Open your SPDY-enabled web browser and navigate to https://127.0.0.1:" + PORT + '/');
            System.err.println("If using Chrome browser, check your SPDY sessions at chrome://net-internals/#spdy");

            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the SpdyServer class?
SpdyServer is a class in the netty codebase, defined in example/src/main/java/io/netty/example/spdy/server/SpdyServer.java.
Where is SpdyServer defined?
SpdyServer is defined in example/src/main/java/io/netty/example/spdy/server/SpdyServer.java at line 49.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free