Class DefaultBHttpServerConnection

    • Constructor Detail

      • DefaultBHttpServerConnection

        public DefaultBHttpServerConnection​(java.lang.String scheme,
                                            Http1Config http1Config,
                                            java.nio.charset.CharsetDecoder charDecoder,
                                            java.nio.charset.CharsetEncoder charEncoder)
      • DefaultBHttpServerConnection

        public DefaultBHttpServerConnection​(java.lang.String scheme,
                                            Http1Config http1Config)
    • Method Detail

      • bind

        public void bind​(java.net.Socket socket)
                  throws java.io.IOException
        Description copied from class: BHttpConnectionBase
        Binds this connection to the given Socket. This socket will be used by the connection to send and receive data.

        After this method's execution the connection status will be reported as open and the BHttpConnectionBase.isOpen() will return true.

        Overrides:
        bind in class BHttpConnectionBase
        Parameters:
        socket - the socket.
        Throws:
        java.io.IOException - in case of an I/O error.
      • receiveRequestHeader

        public ClassicHttpRequest receiveRequestHeader()
                                                throws HttpException,
                                                       java.io.IOException
        Description copied from interface: HttpServerConnection
        Receives the request line and all headers available from this connection. The caller should examine the returned request and decide if to receive a request entity as well.
        Specified by:
        receiveRequestHeader in interface HttpServerConnection
        Returns:
        a new HttpRequest object whose request line and headers are initialized or null if the connection has been closed by the opposite endpoint.
        Throws:
        HttpException - in case of HTTP protocol violation
        java.io.IOException - in case of an I/O error
      • receiveRequestEntity

        public void receiveRequestEntity​(ClassicHttpRequest request)
                                  throws HttpException,
                                         java.io.IOException
        Description copied from interface: HttpServerConnection
        Receives the next request entity available from this connection and attaches it to an existing request.
        Specified by:
        receiveRequestEntity in interface HttpServerConnection
        Parameters:
        request - the request to attach the entity to.
        Throws:
        HttpException - in case of HTTP protocol violation
        java.io.IOException - in case of an I/O error