Package io.grpc.netty

Class NettyServer

    • Field Detail

      • log

        private static final java.util.logging.Logger log
      • addresses

        private final java.util.List<? extends java.net.SocketAddress> addresses
      • channelFactory

        private final io.netty.channel.ChannelFactory<? extends io.netty.channel.ServerChannel> channelFactory
      • channelOptions

        private final java.util.Map<io.netty.channel.ChannelOption<?>,​?> channelOptions
      • childChannelOptions

        private final java.util.Map<io.netty.channel.ChannelOption<?>,​?> childChannelOptions
      • maxStreamsPerConnection

        private final int maxStreamsPerConnection
      • bossGroupPool

        private final ObjectPool<? extends io.netty.channel.EventLoopGroup> bossGroupPool
      • workerGroupPool

        private final ObjectPool<? extends io.netty.channel.EventLoopGroup> workerGroupPool
      • forceHeapBuffer

        private final boolean forceHeapBuffer
      • bossGroup

        private io.netty.channel.EventLoopGroup bossGroup
      • workerGroup

        private io.netty.channel.EventLoopGroup workerGroup
      • channelGroup

        private final io.netty.channel.group.ChannelGroup channelGroup
      • autoFlowControl

        private final boolean autoFlowControl
      • flowControlWindow

        private final int flowControlWindow
      • maxMessageSize

        private final int maxMessageSize
      • maxHeaderListSize

        private final int maxHeaderListSize
      • keepAliveTimeInNanos

        private final long keepAliveTimeInNanos
      • keepAliveTimeoutInNanos

        private final long keepAliveTimeoutInNanos
      • maxConnectionIdleInNanos

        private final long maxConnectionIdleInNanos
      • maxConnectionAgeInNanos

        private final long maxConnectionAgeInNanos
      • maxConnectionAgeGraceInNanos

        private final long maxConnectionAgeGraceInNanos
      • permitKeepAliveWithoutCalls

        private final boolean permitKeepAliveWithoutCalls
      • permitKeepAliveTimeInNanos

        private final long permitKeepAliveTimeInNanos
      • maxRstCount

        private final int maxRstCount
      • maxRstPeriodNanos

        private final long maxRstPeriodNanos
      • eagAttributes

        private final Attributes eagAttributes
      • sharedResourceReferenceCounter

        private final io.netty.util.ReferenceCounted sharedResourceReferenceCounter
      • terminated

        private volatile boolean terminated
      • bossExecutor

        private final io.netty.channel.EventLoop bossExecutor
    • Constructor Detail

      • NettyServer

        NettyServer​(java.util.List<? extends java.net.SocketAddress> addresses,
                    io.netty.channel.ChannelFactory<? extends io.netty.channel.ServerChannel> channelFactory,
                    java.util.Map<io.netty.channel.ChannelOption<?>,​?> channelOptions,
                    java.util.Map<io.netty.channel.ChannelOption<?>,​?> childChannelOptions,
                    ObjectPool<? extends io.netty.channel.EventLoopGroup> bossGroupPool,
                    ObjectPool<? extends io.netty.channel.EventLoopGroup> workerGroupPool,
                    boolean forceHeapBuffer,
                    ProtocolNegotiator protocolNegotiator,
                    java.util.List<? extends ServerStreamTracer.Factory> streamTracerFactories,
                    TransportTracer.Factory transportTracerFactory,
                    int maxStreamsPerConnection,
                    boolean autoFlowControl,
                    int flowControlWindow,
                    int maxMessageSize,
                    int maxHeaderListSize,
                    long keepAliveTimeInNanos,
                    long keepAliveTimeoutInNanos,
                    long maxConnectionIdleInNanos,
                    long maxConnectionAgeInNanos,
                    long maxConnectionAgeGraceInNanos,
                    boolean permitKeepAliveWithoutCalls,
                    long permitKeepAliveTimeInNanos,
                    int maxRstCount,
                    long maxRstPeriodNanos,
                    Attributes eagAttributes,
                    InternalChannelz channelz)
    • Method Detail

      • start

        public void start​(ServerListener serverListener)
                   throws java.io.IOException
        Description copied from interface: InternalServer
        Starts transport. Implementations must not call listener until after start() returns. The method only returns after it has done the equivalent of bind()ing, so it will be able to service any connections created after returning.
        Specified by:
        start in interface InternalServer
        Parameters:
        serverListener - non-null listener of server events
        Throws:
        java.io.IOException - if unable to bind
      • shutdown

        public void shutdown()
        Description copied from interface: InternalServer
        Initiates an orderly shutdown of the server. Existing transports continue, but new transports will not be created (once ServerListener.serverShutdown() callback is called). This method may only be called once. Blocks until the listening socket(s) have been closed. If interrupted, this method will not wait for the close to complete, but it will happen asynchronously.
        Specified by:
        shutdown in interface InternalServer
      • getLogId

        public InternalLogId getLogId()
        Description copied from interface: InternalWithLogId
        Returns an ID that is primarily used in debug logs. It usually contains the class name and a numeric ID that is unique among the instances.

        The subclasses of this interface usually want to include the log ID in their Object.toString() results.

        Specified by:
        getLogId in interface InternalWithLogId
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object