Home / Function/ start() — netty Function Reference

start() — netty Function Reference

Architecture documentation for the start() function in StompWebSocketChatServer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  362e4588_7b99_4705_1511_012013017e31["start()"]
  22a0ce7e_5615_9651_fc52_a0b82473cea1["StompWebSocketChatServer"]
  362e4588_7b99_4705_1511_012013017e31 -->|defined in| 22a0ce7e_5615_9651_fc52_a0b82473cea1
  e29ee6d9_e780_f18b_cccc_0e717a31f352["main()"]
  e29ee6d9_e780_f18b_cccc_0e717a31f352 -->|calls| 362e4588_7b99_4705_1511_012013017e31
  style 362e4588_7b99_4705_1511_012013017e31 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/stomp/websocket/StompWebSocketChatServer.java lines 30–47

    public void start(final int port) throws Exception {
        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            ServerBootstrap bootstrap = new ServerBootstrap()
                    .group(group)
                    .channel(NioServerSocketChannel.class)
                    .childHandler(new StompWebSocketChatServerInitializer("/chat"));
            bootstrap.bind(port).addListener(future -> {
                if (future.isSuccess()) {
                    System.out.println("Open your web browser and navigate to http://127.0.0.1:" + PORT + '/');
                } else {
                    System.out.println("Cannot start server, follows exception " + future.cause());
                }
            }).channel().closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does start() do?
start() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/stomp/websocket/StompWebSocketChatServer.java.
Where is start() defined?
start() is defined in example/src/main/java/io/netty/example/stomp/websocket/StompWebSocketChatServer.java at line 30.
What calls start()?
start() is called by 1 function(s): main.

Analyze Your Own Codebase

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

Try Supermodel Free