Class Server

  • All Implemented Interfaces:
    AutoCloseable

    public class Server
    extends Object
    implements AutoCloseable
    The server binds to a defined port and thus allows the node to be discovered and contacted by other peers.
    • Field Detail

      • workerGroup

        public final io.netty.channel.EventLoopGroup workerGroup
      • bossGroup

        public final io.netty.channel.EventLoopGroup bossGroup
      • serverBootstrap

        public final io.netty.bootstrap.ServerBootstrap serverBootstrap
      • channelInitializer

        protected final io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel> channelInitializer
    • Method Detail

      • getEndpoints

        public Set<URI> getEndpoints()
        Returns:
        the endpoints
      • isOpen

        public boolean isOpen()
      • getPort

        public int getPort()
        Returns the actual bind port used by this server.
      • close

        public void close()
        Closes the server socket and all open client sockets.
        Specified by:
        close in interface AutoCloseable