Package com.sun.enterprise.web.connector.grizzly

Examples of com.sun.enterprise.web.connector.grizzly.ByteBufferInputStream


                            // If the protocol wasn't found, it might be because
                            // lack of missing bytes. Thus we must register the key for
                            // extra bytes. The trick here is to re-use the ReadTask
                            // ByteBufferInpuStream.
                            if (bbInputStream == null) {
                                bbInputStream = new ByteBufferInputStream();
                            }
                           
                            ByteBuffer tmpBB = protocolInfo.inputBB;
                           
                            if (tmpBB == null) {
View Full Code Here


        boolean clearBuffer = true;
        try{
            if (cometKey == null || key == null) return;
           
            if (cometInputStream == null){
                cometInputStream = new  ByteBufferInputStream();
            }
           
            if (event == null){
                event = new CometEvent();
            }
View Full Code Here

         * We need to make sure client started to send payload before redirecting/closing
         * the connection. Otherwise client can not receive "HTTP 302 redirect" response.
         */
        ByteBuffer tmpBuffer = protocolInfo.byteBuffer;
        tmpBuffer.clear();
        ByteBufferInputStream is = new ByteBufferInputStream(tmpBuffer);
        try {
            is.setReadTimeout(2);
            is.setSelectionKey(protocolInfo.key);
            int count = 0;
            while (tmpBuffer.hasRemaining() && count < DEFAULT_HTTP_HEADER_BUFFER_SIZE) {
                tmpBuffer.position(tmpBuffer.limit());
                int readBytes = is.read();
                if (readBytes == -1) break;
                count += readBytes;
            }
        } catch(IOException e) {
            // ignore
        } finally {
            is.close();
        }
        //=========================================================
    }
View Full Code Here

         * We need to make sure client started to send payload before redirecting/closing
         * the connection. Otherwise client can not receive "HTTP 302 redirect" response.
         */
        ByteBuffer tmpBuffer = protocolInfo.byteBuffer;
        tmpBuffer.clear();
        ByteBufferInputStream is = new ByteBufferInputStream(tmpBuffer);
        try {
            is.setReadTimeout(2);
            is.setSelectionKey(protocolInfo.key);
            int count = 0;
            while (tmpBuffer.hasRemaining() && count < DEFAULT_HTTP_HEADER_BUFFER_SIZE) {
                tmpBuffer.position(tmpBuffer.limit());
                int readBytes = is.read();
                if (readBytes == -1) break;
                count += readBytes;
            }
        } catch(IOException e) {
            // ignore
        } finally {
            is.close();
        }
        //=========================================================
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.web.connector.grizzly.ByteBufferInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.