Class ConnectHandler.DownstreamConnection

    • Constructor Detail

      • DownstreamConnection

        public DownstreamConnection​(EndPoint endPoint,
                                    java.util.concurrent.Executor executor,
                                    ByteBufferPool bufferPool,
                                    java.util.concurrent.ConcurrentMap<java.lang.String,​java.lang.Object> context)
    • Method Detail

      • onUpgradeTo

        public void onUpgradeTo​(java.nio.ByteBuffer buffer)
        Description copied from interface: Connection.UpgradeTo

        Callback method invoked when this connection is upgraded.

        This must be called before Connection.onOpen().

        Specified by:
        onUpgradeTo in interface Connection.UpgradeTo
        Parameters:
        buffer - An optional buffer that can contain prefilled data. Typically this results from an upgrade of one protocol to the other where the old connection has buffered data destined for the new connection. The new connection must take ownership of the buffer and is responsible for returning it to the buffer pool
      • onOpen

        public void onOpen()
        Description copied from interface: Connection

        Callback method invoked when this connection is opened.

        Creators of the connection implementation are responsible for calling this method.

        Specified by:
        onOpen in interface Connection
        Overrides:
        onOpen in class AbstractConnection
      • read

        protected int read​(EndPoint endPoint,
                           java.nio.ByteBuffer buffer)
                    throws java.io.IOException
        Specified by:
        read in class ProxyConnection
        Throws:
        java.io.IOException