org.apache.avro.ipc.netty

## Class NettyServer

- java.lang.Object
- - org.apache.avro.ipc.netty.NettyServer

- All Implemented Interfaces:
    Server

      public class NettyServer
      extends Object
      implements Server

  A Netty-based RPC `Server` implementation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NettyServer(Responder responder, InetSocketAddress addr)`
    `NettyServer(Responder responder, InetSocketAddress addr, Consumer<io.netty.channel.socket.SocketChannel> initializer)`
    `NettyServer(Responder responder, InetSocketAddress addr, Consumer<io.netty.channel.socket.SocketChannel> initializer, Consumer<io.netty.bootstrap.ServerBootstrap> bootStrapInitialzier)`
    `NettyServer(Responder responder, InetSocketAddress addr, Consumer<io.netty.channel.socket.SocketChannel> initializer, Consumer<io.netty.bootstrap.ServerBootstrap> bootStrapInitialzier, io.netty.channel.EventLoopGroup bossGroup, io.netty.channel.EventLoopGroup workerGroup, io.netty.channel.EventLoopGroup callerGroup)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Stop this server.
    `int` | `getNumActiveConnections()`
    `int` | `getPort()` The port this server runs on.
    `void` | `join()` Wait for this server to exit.
    `void` | `start()` Start this server.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NettyServer

          public NettyServer(Responder responder,
                             InetSocketAddress addr)
                      throws InterruptedException

      Throws:
        `InterruptedException`

    - #### NettyServer

          public NettyServer(Responder responder,
                             InetSocketAddress addr,
                             Consumer<io.netty.channel.socket.SocketChannel> initializer)
                      throws InterruptedException

      Throws:
        `InterruptedException`

    - #### NettyServer

          public NettyServer(Responder responder,
                             InetSocketAddress addr,
                             Consumer<io.netty.channel.socket.SocketChannel> initializer,
                             Consumer<io.netty.bootstrap.ServerBootstrap> bootStrapInitialzier)
                      throws InterruptedException

      Throws:
        `InterruptedException`

    - #### NettyServer

          public NettyServer(Responder responder,
                             InetSocketAddress addr,
                             Consumer<io.netty.channel.socket.SocketChannel> initializer,
                             Consumer<io.netty.bootstrap.ServerBootstrap> bootStrapInitialzier,
                             io.netty.channel.EventLoopGroup bossGroup,
                             io.netty.channel.EventLoopGroup workerGroup,
                             io.netty.channel.EventLoopGroup callerGroup)
                      throws InterruptedException

      Throws:
        `InterruptedException`

  - ### Method Detail

    - #### start

          public void start()

      Description copied from interface: `Server`
      Start this server.
      Specified by:
        `start` in interface `Server`

    - #### close

          public void close()

      Description copied from interface: `Server`
      Stop this server.
      Specified by:
        `close` in interface `Server`

    - #### getPort

          public int getPort()

      Description copied from interface: `Server`
      The port this server runs on.
      Specified by:
        `getPort` in interface `Server`

    - #### join

          public void join()
                    throws InterruptedException

      Description copied from interface: `Server`
      Wait for this server to exit.
      Specified by:
        `join` in interface `Server`
      Throws:
        `InterruptedException`

    - #### getNumActiveConnections

          public int getNumActiveConnections()

      Returns:
        The number of clients currently connected to this server.

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.