亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? selectchannelconnector.java

?? 著名服務(wù)器nio的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
// ========================================================================// Copyright 2003-2005 Mort Bay Consulting Pty. Ltd.// ------------------------------------------------------------------------// Licensed under the Apache License, Version 2.0 (the "License");// you may not use this file except in compliance with the License.// You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0// Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License.// ========================================================================package org.mortbay.jetty.nio;import java.io.IOException;import java.net.InetSocketAddress;import java.net.Socket;import java.nio.channels.SelectionKey;import java.nio.channels.ServerSocketChannel;import java.nio.channels.SocketChannel;import org.mortbay.io.Connection;import org.mortbay.io.nio.SelectChannelEndPoint;import org.mortbay.io.nio.SelectorManager;import org.mortbay.io.nio.SelectorManager.SelectSet;import org.mortbay.jetty.HttpConnection;import org.mortbay.jetty.Request;import org.mortbay.jetty.RetryRequest;import org.mortbay.log.Log;import org.mortbay.thread.Timeout;import org.mortbay.util.ajax.Continuation;/* ------------------------------------------------------------------------------- *//** * Selecting NIO connector. * <p> * This connector uses efficient NIO buffers with a non blocking threading model. Direct NIO buffers * are used and threads are only allocated to connections with requests. Synchronization is used to * simulate blocking for the servlet API, and any unflushed content at the end of request handling * is written asynchronously. * </p> * <p> * This connector is best used when there are a many connections that have idle periods. * </p> * <p> * When used with {@link org.mortbay.util.ajax.Continuation}, threadless waits are supported. When * a filter or servlet calls getEvent on a Continuation, a {@link org.mortbay.jetty.RetryRequest} * runtime exception is thrown to allow the thread to exit the current request handling. Jetty will * catch this exception and will not send a response to the client. Instead the thread is released * and the Continuation is placed on the timer queue. If the Continuation timeout expires, or it's * resume method is called, then the request is again allocated a thread and the request is retried. * The limitation of this approach is that request content is not available on the retried request, * thus if possible it should be read after the continuation or saved as a request attribute or as the * associated object of the Continuation instance. * </p> *  * @org.apache.xbean.XBean element="nioConnector" description="Creates an NIO based socket connector" *  * @author gregw * */public class SelectChannelConnector extends AbstractNIOConnector {    private transient ServerSocketChannel _acceptChannel;    private long _lowResourcesConnections;    private long _lowResourcesMaxIdleTime;    private SelectorManager _manager = new SelectorManager()    {        protected SocketChannel acceptChannel(SelectionKey key) throws IOException        {            // TODO handle max connections            SocketChannel channel = ((ServerSocketChannel)key.channel()).accept();            if (channel==null)                return null;            channel.configureBlocking(false);            Socket socket = channel.socket();            configure(socket);            return channel;        }        public boolean dispatch(Runnable task) throws IOException        {            return getThreadPool().dispatch(task);        }        protected void endPointClosed(SelectChannelEndPoint endpoint)        {            // TODO handle max connections and low resources            connectionClosed((HttpConnection)endpoint.getConnection());        }        protected void endPointOpened(SelectChannelEndPoint endpoint)        {            // TODO handle max connections and low resources            connectionOpened((HttpConnection)endpoint.getConnection());        }        protected Connection newConnection(SocketChannel channel,SelectChannelEndPoint endpoint)        {            return SelectChannelConnector.this.newConnection(channel,endpoint);        }        protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey sKey) throws IOException        {            return SelectChannelConnector.this.newEndPoint(channel,selectSet,sKey);        }    };        /* ------------------------------------------------------------------------------- */    /**     * Constructor.     *      */    public SelectChannelConnector()    {    }        /* ------------------------------------------------------------ */    public void accept(int acceptorID) throws IOException    {        _manager.doSelect(acceptorID);    }        /* ------------------------------------------------------------ */    public void close() throws IOException    {        synchronized(this)        {            if (_acceptChannel != null)                _acceptChannel.close();            _acceptChannel = null;        }    }        /* ------------------------------------------------------------------------------- */    public void customize(org.mortbay.io.EndPoint endpoint, Request request) throws IOException    {        ConnectorEndPoint cep = ((ConnectorEndPoint)endpoint);        cep.cancelIdle();        request.setTimeStamp(cep.getSelectSet().getNow());        super.customize(endpoint, request);    }        /* ------------------------------------------------------------------------------- */    public void persist(org.mortbay.io.EndPoint endpoint) throws IOException    {        ((ConnectorEndPoint)endpoint).scheduleIdle();        super.persist(endpoint);    }    /* ------------------------------------------------------------ */    public Object getConnection()    {        return _acceptChannel;    }        /* ------------------------------------------------------------ */    /** Get delay select key update     * If true, the select set is not updated when a endpoint is dispatched for     * reading. The assumption is that the task will be short and thus will probably     * be complete before the select is tried again.     * @return Returns the assumeShortDispatch.     */    public boolean getDelaySelectKeyUpdate()    {        return _manager.isDelaySelectKeyUpdate();    }    /* ------------------------------------------------------------------------------- */    public int getLocalPort()    {        synchronized(this)        {            if (_acceptChannel==null || !_acceptChannel.isOpen())                return -1;            return _acceptChannel.socket().getLocalPort();        }    }    /* ------------------------------------------------------------ */    /*     * @see org.mortbay.jetty.Connector#newContinuation()     */    public Continuation newContinuation()    {        return new RetryContinuation();    }    /* ------------------------------------------------------------ */    public void open() throws IOException    {        synchronized(this)        {            if (_acceptChannel == null)            {                // Create a new server socket                _acceptChannel = ServerSocketChannel.open();                // Bind the server socket to the local host and port                _acceptChannel.socket().setReuseAddress(getReuseAddress());                InetSocketAddress addr = getHost()==null?new InetSocketAddress(getPort()):new InetSocketAddress(getHost(),getPort());                _acceptChannel.socket().bind(addr,getAcceptQueueSize());                // Set to non blocking mode                _acceptChannel.configureBlocking(false);                            }        }    }    /* ------------------------------------------------------------ */    /**     * @param delay If true, updating a {@link SelectionKey} is delayed until a redundant event is      * schedules.  This is an optimization that assumes event handling can be completed before the next select     * completes.     */    public void setDelaySelectKeyUpdate(boolean delay)    {        _manager.setDelaySelectKeyUpdate(delay);    }    /* ------------------------------------------------------------ */    public void setMaxIdleTime(int maxIdleTime)    {        _manager.setMaxIdleTime(maxIdleTime);        super.setMaxIdleTime(maxIdleTime);    }    /* ------------------------------------------------------------ */    /**     * @return the lowResourcesConnections     */    public long getLowResourcesConnections()    {        return _lowResourcesConnections;    }    /* ------------------------------------------------------------ */    /**     * Set the number of connections, which if exceeded places this manager in low resources state.     * This is not an exact measure as the connection count is averaged over the select sets.     * @param lowResourcesConnections the number of connections     * @see {@link #setLowResourcesMaxIdleTime(long)}     */    public void setLowResourcesConnections(long lowResourcesConnections)    {        _lowResourcesConnections=lowResourcesConnections;    }    /* ------------------------------------------------------------ */    /**     * @return the lowResourcesMaxIdleTime     */    public long getLowResourcesMaxIdleTime()    {        return _lowResourcesMaxIdleTime;    }    /* ------------------------------------------------------------ */    /**     * Set the period in ms that a connection is allowed to be idle when this there are more     * than {@link #getLowResourcesConnections()} connections.  This allows the server to rapidly close idle connections     * in order to gracefully handle high load situations.     * @param lowResourcesMaxIdleTime the period in ms that a connection is allowed to be idle when resources are low.     * @see {@link #setMaxIdleTime(long)}     * @deprecated use {@link #setLowResourceMaxIdleTime(int)}     */    public void setLowResourcesMaxIdleTime(long lowResourcesMaxIdleTime)    {        _lowResourcesMaxIdleTime=lowResourcesMaxIdleTime;        super.setLowResourceMaxIdleTime((int)lowResourcesMaxIdleTime); // TODO fix the name duplications    }    /* ------------------------------------------------------------ */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97久久超碰精品国产| 色久综合一二码| 91免费观看在线| 精品国产髙清在线看国产毛片| 国产欧美精品在线观看| 视频在线观看一区| 91久久精品一区二区三| 国产日本亚洲高清| 蜜桃久久久久久| 欧美性受xxxx黑人xyx性爽| 亚洲国产精品成人综合| 蜜桃av一区二区三区电影| 欧美日韩一卡二卡三卡| 国产精品美女www爽爽爽| 韩国女主播一区| 欧美一级精品大片| 午夜精品久久久久久久久久| 91日韩精品一区| 国产精品乱码人人做人人爱| 国产一区二区按摩在线观看| 91精品国产综合久久久蜜臀图片| 一区二区在线电影| 91视频com| 亚洲最大色网站| 在线观看不卡一区| 亚洲一级在线观看| 欧美日韩高清一区二区三区| 一区二区国产视频| 欧美亚洲日本国产| 亚洲国产欧美另类丝袜| 欧美日韩精品一区二区在线播放| 亚洲日本va午夜在线影院| 99精品偷自拍| 一区二区三区四区在线免费观看| 色哟哟一区二区| 亚洲免费在线播放| 日本电影欧美片| 一区二区三区四区乱视频| 欧美在线色视频| 日本不卡一区二区三区高清视频| 欧美一区二区三区四区在线观看| 热久久国产精品| 2024国产精品| 成人国产精品免费观看动漫| 亚洲人妖av一区二区| 在线观看欧美日本| 免费观看成人av| 久久久久久综合| 成人av电影在线观看| 一个色在线综合| 678五月天丁香亚洲综合网| 免费久久99精品国产| 精品成人一区二区| 91在线你懂得| 午夜国产不卡在线观看视频| 日韩女优毛片在线| eeuss鲁片一区二区三区在线观看| 亚洲精品高清在线观看| 91麻豆精品91久久久久同性| 国产精品乡下勾搭老头1| 亚洲私人黄色宅男| 欧美日韩美女一区二区| 国产主播一区二区三区| 亚洲视频电影在线| 日韩视频在线你懂得| 成人在线视频一区| 日韩精品亚洲专区| 国产精品三级视频| 91精品国产福利| 成人高清av在线| 日本免费在线视频不卡一不卡二| 久久色成人在线| 欧美三级电影在线看| 国产成人av福利| 香蕉乱码成人久久天堂爱免费| 精品国产1区2区3区| 在线免费观看日本欧美| 极品瑜伽女神91| 亚洲电影欧美电影有声小说| 日本一区二区综合亚洲| 欧美日韩免费观看一区二区三区| 激情欧美日韩一区二区| 亚洲宅男天堂在线观看无病毒| 精品91自产拍在线观看一区| 欧美三级乱人伦电影| www.66久久| 国产一区二区按摩在线观看| 日韩成人精品在线| 亚洲午夜一区二区三区| 国产精品久久一级| 精品久久久久一区| 91精品国产入口| 在线视频中文字幕一区二区| 成人美女视频在线观看| 极品美女销魂一区二区三区免费| 五月天激情小说综合| 亚洲视频在线观看一区| 日本一区二区三区久久久久久久久不 | 99re6这里只有精品视频在线观看| 日本不卡视频在线观看| 亚洲第一在线综合网站| 亚洲免费三区一区二区| 国产精品久久看| 久久精品人人做| 久久久久久一级片| 久久久精品国产免大香伊| 精品欧美久久久| 精品入口麻豆88视频| 欧美一卡2卡三卡4卡5免费| 欧美日韩免费电影| 3751色影院一区二区三区| 欧美日韩一二区| 欧美久久久一区| 欧美精品在线视频| 制服丝袜亚洲色图| 欧美一区二区人人喊爽| 91精品国产综合久久久久久| 91精品国产色综合久久不卡电影 | 91一区二区三区在线观看| 风间由美一区二区av101| 国产不卡视频一区| www.66久久| 日本道色综合久久| 欧美人妇做爰xxxⅹ性高电影| 欧美日韩精品久久久| 91精品蜜臀在线一区尤物| 精品伦理精品一区| 国产亚洲va综合人人澡精品 | 另类的小说在线视频另类成人小视频在线| 午夜激情久久久| 狠狠色丁香九九婷婷综合五月| 国产伦精品一区二区三区免费迷| 国产成人精品综合在线观看 | 日韩av不卡在线观看| 免费成人av资源网| 国产91富婆露脸刺激对白| 9i在线看片成人免费| 欧美日韩午夜在线| 欧美一区在线视频| 日本一区二区三级电影在线观看| 亚洲欧美在线高清| 视频在线观看一区| 国产成都精品91一区二区三| 在线日韩av片| 久久精品视频一区二区| 亚洲欧美色综合| 美女精品一区二区| 99久久精品免费| 制服丝袜日韩国产| 中文字幕在线视频一区| 午夜久久久影院| 成人永久aaa| 欧美一区二区视频网站| 国产精品色一区二区三区| 日韩精品电影在线观看| 国产91对白在线观看九色| 777奇米四色成人影色区| 久久久精品国产99久久精品芒果| 亚洲品质自拍视频| 久久99国产精品久久| 91久久人澡人人添人人爽欧美 | 亚洲激情图片一区| 一本一道久久a久久精品| 欧美老肥妇做.爰bbww视频| 国产视频亚洲色图| 亚洲第一在线综合网站| k8久久久一区二区三区 | 欧美三级日韩在线| 国产精品网站在线观看| 日产欧产美韩系列久久99| 91麻豆免费看片| 国产亚洲一区字幕| 蜜臀av一区二区在线免费观看| 91蜜桃视频在线| 中文av一区二区| 国产老女人精品毛片久久| 日韩欧美高清在线| 日韩和欧美的一区| 在线精品亚洲一区二区不卡| 久久中文娱乐网| 另类成人小视频在线| 91麻豆精品国产91久久久久| 一区二区三区中文字幕| 91亚洲精品乱码久久久久久蜜桃| 久久久久久久综合色一本| 麻豆freexxxx性91精品| 制服丝袜亚洲播放| 日日夜夜一区二区| 欧美精品 国产精品| 亚洲国产综合在线| 在线国产电影不卡| 亚洲在线视频一区| 欧美色图激情小说| 亚洲高清一区二区三区| 欧美三级日韩在线| 日韩专区在线视频| 欧美剧情片在线观看| 免费观看日韩电影| 欧美xxxxxxxxx| 精品一区二区三区免费视频|