Package org.apache.mina.transport.nio

Examples of org.apache.mina.transport.nio.FixedSelectorLoopPool


        server.unbind();
    }

    @Test
    public void generateAllKindOfServerEventOneSelector() throws IOException, InterruptedException {
        SelectorLoopPool selectorLoopPool = new FixedSelectorLoopPool("Server", 1);
        final NioTcpServer server = new NioTcpServer(selectorLoopPool.getSelectorLoop(), selectorLoopPool, null);
        server.setFilters();
        server.setIoHandler(new Handler());
        server.bind(0);

        // warm up
View Full Code Here


     * correctly process the sessionOpened, messageReceived, messageSent and sessionClosed events. We use only one
     * selector to process all the OP events.
     */
    @Test
    public void generateAllKindOfServerEventOneSelector() throws IOException, InterruptedException {
        SelectorLoopPool selectorLoopPool = new FixedSelectorLoopPool("Server", 1);
        final NioTcpServer server = new NioTcpServer(selectorLoopPool.getSelectorLoop(), selectorLoopPool, null);
        server.setFilters(new MyCodec(), new Handler());
        server.bind(0);
        // warm up
        Thread.sleep(100);

View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void start(int port) throws IOException {
        tcpServer = new NioTcpServer(new FixedSelectorLoopPool("Server", 1), null);
        tcpServer.getSessionConfig().setReadBufferSize(128 * 1024);
        tcpServer.getSessionConfig().setTcpNoDelay(true);
        tcpServer.setIoHandler(new IoHandler() {
            public void sessionOpened(IoSession session) {
                session.setAttribute(STATE_ATTRIBUTE, State.WAIT_FOR_FIRST_BYTE_LENGTH);
View Full Code Here

TOP

Related Classes of org.apache.mina.transport.nio.FixedSelectorLoopPool

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.