Package org.apache.mina.api

Examples of org.apache.mina.api.AbstractIoHandler


        /*
         * Server
         */
        server.setReuseAddress(true);
        server.getSessionConfig().setSslContext(createSSLContext());
        server.setIoHandler(new AbstractIoHandler() {
            private int receivedSize = 0;

            /**
             * {@inheritedDoc}
             */
 
View Full Code Here


        NioTcpServer server = new NioTcpServer();
        server.setIoHandler(new Handler());
        server.bind(0);

        NioTcpClient client = new NioTcpClient();
        client.setIoHandler(new AbstractIoHandler() {
        });
        for (int i = 0; i < CLIENT_COUNT; ++i) {
            client.connect(new InetSocketAddress(server.getServerSocketChannel().socket().getLocalPort())).get();
        }
        client.disconnect();
View Full Code Here

        final NioTcpServer acceptor = new NioTcpServer();

        // create the filter chain for this service
        acceptor.setFilters(new LoggingFilter("LoggingFilter1"));

        acceptor.setIoHandler(new AbstractIoHandler() {
            @Override
            public void sessionOpened(final IoSession session) {
                LOG.info("session opened {}", session);

                final String welcomeStr = "welcome\n";
View Full Code Here

        server.setFilters(new ProtocolCodecFilter<CoapMessage, ByteBuffer, Void, Void>(
                new CoapEncoder(), new CoapDecoder()), rq);
        // idle in 10 minute
        server.getSessionConfig().setIdleTimeInMillis(IdleStatus.READ_IDLE, 60 * 10_000);
        server.setIoHandler(new AbstractIoHandler() {

            long start = System.currentTimeMillis();
            int count = 0;

            @Override
View Full Code Here

    public static void main(String[] args) {
        LOG.info("starting echo client");

        final NioTcpClient client = new NioTcpClient();
        client.setFilters();
        client.setIoHandler(new AbstractIoHandler() {
            @Override
            public void sessionOpened(final IoSession session) {
                LOG.info("session opened {}", session);
            }
View Full Code Here

            public void messageSent(final IoSession session, final Object message) {
                LOG.info("message {} sent", message);
            }
        });

        server.setIoHandler(new AbstractIoHandler() {
            @Override
            public void sessionOpened(final IoSession session) {
                LOG.info("session opened {}", session);

                final String welcomeStr = "welcome\n";
View Full Code Here

        final NioUdpServer server = new NioUdpEchoServer();

        // create the filter chain for this service
        server.setFilters(new LoggingFilter("LoggingFilter1"), ((NioUdpEchoServer) server).new UdpEchoFilter());

        server.setIoHandler(new AbstractIoHandler() {
            @Override
            public void sessionOpened(final IoSession session) {
                LOG.info("session opened {}", session);

                final String welcomeStr = "welcome\n";
View Full Code Here

        server.setFilters(new ProtocolCodecFilter<CoapMessage, ByteBuffer, Void, Void>(
                new CoapEncoder(), new CoapDecoder()), rq);
        // idle in 10 minute
        server.getSessionConfig().setIdleTimeInMillis(IdleStatus.READ_IDLE, 60 * 10_000);
        server.setIoHandler(new AbstractIoHandler() {

            long start = System.currentTimeMillis();
            int count = 0;

            @Override
View Full Code Here

        server.getSessionConfig().setIdleTimeInMillis(IdleStatus.WRITE_IDLE, 60 * 600 * 1000);

        // create the filter chain for this service
        server.setFilters(new MonitoringFilter(metrics), new LoggingFilter("LoggingFilter1"),
                ((NioTcpEchoServerWithMonitoring) server).new TcpEchoFilter());
        server.setIoHandler(new AbstractIoHandler() {
            @Override
            public void sessionOpened(final IoSession session) {
                LOG.info("session opened {}", session);

                final String welcomeStr = "welcome\n";
View Full Code Here

TOP

Related Classes of org.apache.mina.api.AbstractIoHandler

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.