Package io.grpc.netty

Class NettyServerTransport

    • Field Detail

      • connectionLog

        private static final java.util.logging.Logger connectionLog
      • QUIET_EXCEPTIONS

        private static final com.google.common.collect.ImmutableList<java.lang.String> QUIET_EXCEPTIONS
      • channel

        private final io.netty.channel.Channel channel
      • channelUnused

        private final io.netty.channel.ChannelPromise channelUnused
      • maxStreams

        private final int maxStreams
      • terminated

        private boolean terminated
      • 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
    • Constructor Detail

      • NettyServerTransport

        NettyServerTransport​(io.netty.channel.Channel channel,
                             io.netty.channel.ChannelPromise channelUnused,
                             ProtocolNegotiator protocolNegotiator,
                             java.util.List<? extends ServerStreamTracer.Factory> streamTracerFactories,
                             TransportTracer transportTracer,
                             int maxStreams,
                             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)
    • Method Detail

      • getScheduledExecutorService

        public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
        Description copied from interface: ServerTransport
        Returns an executor for scheduling provided by the transport. The service should be configured to allow cancelled scheduled runnables to be GCed.

        The executor may not be used after the transport terminates. The caller should ensure any outstanding tasks are cancelled when the transport terminates.

        Specified by:
        getScheduledExecutorService in interface ServerTransport
      • shutdown

        public void shutdown()
        Description copied from interface: ServerTransport
        Initiates an orderly shutdown of the transport. Existing streams continue, but new streams will eventually begin failing. New streams "eventually" begin failing because shutdown may need to be processed on a separate thread. May only be called once.
        Specified by:
        shutdown in interface ServerTransport
      • shutdownNow

        public void shutdownNow​(Status reason)
        Description copied from interface: ServerTransport
        Initiates a forceful shutdown in which preexisting and new calls are closed. Existing calls should be closed with the provided reason.
        Specified by:
        shutdownNow in interface ServerTransport
      • 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
      • channel

        io.netty.channel.Channel channel()
        For testing purposes only.
      • getLogLevel

        static java.util.logging.Level getLogLevel​(java.lang.Throwable t)
        Accepts a throwable and returns the appropriate logging level. Uninteresting exceptions should not clutter the log.
      • notifyTerminated

        private void notifyTerminated​(java.lang.Throwable t)
      • toString

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

        private NettyServerHandler createHandler​(ServerTransportListener transportListener,
                                                 io.netty.channel.ChannelPromise channelUnused)
        Creates the Netty handler to be used in the channel pipeline.