main() — netty Function Reference
Architecture documentation for the main() function in SpdyServer.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 4d96ea7a_0546_7c23_bb68_ce4c7db36e49["main()"] d5aca0fd_5a57_358b_62e5_cf1a2057efce["SpdyServer"] 4d96ea7a_0546_7c23_bb68_ce4c7db36e49 -->|defined in| d5aca0fd_5a57_358b_62e5_cf1a2057efce style 4d96ea7a_0546_7c23_bb68_ce4c7db36e49 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
example/src/main/java/io/netty/example/spdy/server/SpdyServer.java lines 53–89
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();
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does main() do?
main() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/spdy/server/SpdyServer.java.
Where is main() defined?
main() is defined in example/src/main/java/io/netty/example/spdy/server/SpdyServer.java at line 53.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free