Package org.apache.mina.transport.nio

Examples of org.apache.mina.transport.nio.NioTcpServer.unbind()


        }

        // does the session close event was fired ?
        assertTrue(closedLatch.await(WAIT_TIME, TimeUnit.MILLISECONDS));

        server.unbind();
    }

    @Test
    public void generateAllKindOfServerEventOneSelector() throws IOException, InterruptedException {
        SelectorLoopPool selectorLoopPool = new FixedSelectorLoopPool("Server", 1);
View Full Code Here


        }

        // does the session close event was fired ?
        assertTrue(closedLatch.await(WAIT_TIME, TimeUnit.MILLISECONDS));

        server.unbind();
    }

    private class Handler extends AbstractIoHandler {

        @Override
View Full Code Here

        long t1 = System.currentTimeMillis();

        System.out.println("Delta = " + (t1 - t0));

        server.unbind();
    }

    /**
     * A test that creates 50 clients, each one of them writing one message. We will check that for each client we
     * correctly process the sessionOpened, messageReceived, messageSent and sessionClosed events. We use only one
View Full Code Here

        long t1 = System.currentTimeMillis();

        System.out.println("Delta = " + (t1 - t0));

        server.unbind();
    }

    private class MyCodec extends AbstractIoFilter {

        @Override
View Full Code Here

            final SocketAddress address = new InetSocketAddress(9999);
            acceptor.bind(address);
            LOG.debug("Running the server for 25 sec");
            Thread.sleep(25000);
            LOG.debug("Unbinding the TCP port");
            acceptor.unbind();
        } catch (final InterruptedException e) {
            LOG.error("Interrupted exception", e);
        }
    }
}
View Full Code Here

        httpServer.bind(new InetSocketAddress(8080));

        // run for 20 seconds
        Thread.sleep(20000);
        httpServer.unbind();

    }

    private static class DummyHttpSever extends AbstractIoFilter {
View Full Code Here

        httpServer.bind(new InetSocketAddress(8080));

        // run for 20 seconds
        Thread.sleep(20000);
        httpServer.unbind();

    }

    private static class DummyHttpSever extends AbstractIoFilter {
View Full Code Here

            final SocketAddress address = new InetSocketAddress(51000);
            server.bind(address);
            LOG.debug("Running the server for 25 sec");
            Thread.sleep(25000 * 1000);
            LOG.debug("Unbinding the UDP port");
            server.unbind();
        } catch (final InterruptedException e) {
            LOG.error("Interrupted exception", e);
        } finally {
            reporter.stop();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.