Class AbstractServerConnection

    • Field Detail

      • channel

        protected final org.xnio.StreamConnection channel
      • closeSetter

        protected final io.undertow.server.AbstractServerConnection.CloseSetter closeSetter
      • undertowOptions

        protected final org.xnio.OptionMap undertowOptions
      • originalSourceConduit

        protected final org.xnio.conduits.StreamSourceConduit originalSourceConduit
      • originalSinkConduit

        protected final org.xnio.conduits.StreamSinkConduit originalSinkConduit
      • extraBytes

        protected PooledByteBuffer extraBytes
        Any extra bytes that were read from the channel. This could be data for this requests, or the next response.
    • Constructor Detail

      • AbstractServerConnection

        public AbstractServerConnection​(org.xnio.StreamConnection channel,
                                        ByteBufferPool bufferPool,
                                        HttpHandler rootHandler,
                                        org.xnio.OptionMap undertowOptions,
                                        int bufferSize)
    • Method Detail

      • getRootHandler

        public HttpHandler getRootHandler()
        Get the root HTTP handler for this connection.
        Returns:
        the root HTTP handler for this connection
      • getChannel

        public org.xnio.StreamConnection getChannel()
        Get the underlying channel.
        Returns:
        the underlying channel
      • getCloseSetter

        public org.xnio.ChannelListener.Setter<ServerConnection> getCloseSetter()
      • getWorker

        public org.xnio.XnioWorker getWorker()
        Specified by:
        getWorker in interface org.xnio.channels.CloseableChannel
        Specified by:
        getWorker in class ServerConnection
        Returns:
        The connections worker
      • getIoThread

        public org.xnio.XnioIoThread getIoThread()
        Specified by:
        getIoThread in interface org.xnio.channels.CloseableChannel
        Specified by:
        getIoThread in class ServerConnection
        Returns:
        The IO thread associated with the connection
      • supportsOption

        public boolean supportsOption​(org.xnio.Option<?> option)
        Specified by:
        supportsOption in interface org.xnio.channels.Configurable
        Specified by:
        supportsOption in class ServerConnection
      • getPeerAddress

        public SocketAddress getPeerAddress()
        Description copied from class: ServerConnection
        Returns the actual address of the remote connection. This will not take things like X-Forwarded-for into account.
        Specified by:
        getPeerAddress in interface org.xnio.channels.ConnectedChannel
        Specified by:
        getPeerAddress in class ServerConnection
        Returns:
        The address of the remote peer
      • getPeerAddress

        public <A extends SocketAddress> A getPeerAddress​(Class<A> type)
        Description copied from class: ServerConnection
        Returns the actual address of the remote connection. This will not take things like X-Forwarded-for into account.
        Specified by:
        getPeerAddress in interface org.xnio.channels.ConnectedChannel
        Specified by:
        getPeerAddress in class ServerConnection
        Type Parameters:
        A - The address type
        Parameters:
        type - The type of address to return
        Returns:
        The remote endpoint address
      • getBufferSize

        public int getBufferSize()
        Specified by:
        getBufferSize in class ServerConnection
        Returns:
        The size of the buffers allocated by the buffer pool
      • getOriginalSourceConduit

        public org.xnio.conduits.StreamSourceConduit getOriginalSourceConduit()
        Returns:
        The original source conduit
      • getOriginalSinkConduit

        public org.xnio.conduits.StreamSinkConduit getOriginalSinkConduit()
        Returns:
        The original underlying sink conduit
      • clearChannel

        public void clearChannel()
        Resets the channel to its original state, effectively disabling all current conduit wrappers. The current state is lost.