
package org.apache.coyote.http11.upgrade;

import java.io.IOException;
import java.net.Socket;

import javax.servlet.http.HttpUpgradeHandler;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.net.SocketWrapper;

public class BioProcessor extends AbstractProcessor<Socket> {

    private static final Log log = LogFactory.getLog(BioProcessor.class);
    @Override
    protected Log getLog() {return log;}

    private static final int INFINITE_TIMEOUT = 0;

    public BioProcessor(SocketWrapper<Socket> wrapper,
            HttpUpgradeHandler httpUpgradeProcessor,
            int asyncWriteBufferSize) throws IOException {
        super(httpUpgradeProcessor, new BioServletInputStream(wrapper),
                new BioServletOutputStream(wrapper, asyncWriteBufferSize));

        wrapper.getSocket().setSoTimeout(INFINITE_TIMEOUT);
    }
}
