Home / Class/ StompWebSocketChatServer Class — netty Architecture

StompWebSocketChatServer Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  22a0ce7e_5615_9651_fc52_a0b82473cea1["StompWebSocketChatServer"]
  619b0941_9e3f_38eb_14a8_8b9be2f48674["StompWebSocketChatServer.java"]
  22a0ce7e_5615_9651_fc52_a0b82473cea1 -->|defined in| 619b0941_9e3f_38eb_14a8_8b9be2f48674
  362e4588_7b99_4705_1511_012013017e31["start()"]
  22a0ce7e_5615_9651_fc52_a0b82473cea1 -->|method| 362e4588_7b99_4705_1511_012013017e31
  e29ee6d9_e780_f18b_cccc_0e717a31f352["main()"]
  22a0ce7e_5615_9651_fc52_a0b82473cea1 -->|method| e29ee6d9_e780_f18b_cccc_0e717a31f352

Relationship Graph

Source Code

example/src/main/java/io/netty/example/stomp/websocket/StompWebSocketChatServer.java lines 26–52

public class StompWebSocketChatServer {

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

    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();
        }
    }

    public static void main(String[] args) throws Exception {
        new StompWebSocketChatServer().start(PORT);
    }
}

Frequently Asked Questions

What is the StompWebSocketChatServer class?
StompWebSocketChatServer is a class in the netty codebase, defined in example/src/main/java/io/netty/example/stomp/websocket/StompWebSocketChatServer.java.
Where is StompWebSocketChatServer defined?
StompWebSocketChatServer is defined in example/src/main/java/io/netty/example/stomp/websocket/StompWebSocketChatServer.java at line 26.

Analyze Your Own Codebase

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

Try Supermodel Free