Package org.apache.mina.transport.socket.nio

Examples of org.apache.mina.transport.socket.nio.NioSocketAcceptor.bind()


        // Inject the TestLine codec filter
        filters.addLast("text", new ProtocolCodecFilter(new TextLineCodecFactory()));

        acceptor.setHandler(new TestHandler());
        acceptor.bind(new InetSocketAddress(port));
    }

    /**
     * Starts a client which will connect twice using SSL
     */
 
View Full Code Here


      statusAcceptor.setHandler(new UrlSaveHandler()); // 处理线程
      statusAcceptor.getSessionConfig().setReadBufferSize(2048);
      statusAcceptor.getSessionConfig().setIdleTime(
          IdleStatus.WRITER_IDLE, 1);
      statusAcceptor.bind(new InetSocketAddress(URLSAVEPORT));

      logger.info("url 接收中心启动 ,占用端口 : " + URLSAVEPORT);
    } catch (Exception e) {
      logger.error("url 接收中心启动失败  ", e);
    }
View Full Code Here

      statusAcceptor.setHandler(new TaskStateHandler()); // 处理线程

      statusAcceptor.getSessionConfig().setReadBufferSize(2048);
      statusAcceptor.getSessionConfig().setIdleTime(
          IdleStatus.WRITER_IDLE, 1);
      statusAcceptor.bind(new InetSocketAddress(STATEPORT));

      logger.info("url 状态中心启动 ,占用端口 : " + STATEPORT);
    } catch (Exception e) {
      logger.error("url 状态中心启动失败  ", e);
    }
View Full Code Here

      queueAcceptor.setHandler(new TaskQueueHandler()); // 处理线程

      queueAcceptor.getSessionConfig().setReadBufferSize(2048);
      queueAcceptor.getSessionConfig().setIdleTime(
          IdleStatus.WRITER_IDLE, 1);
      queueAcceptor.bind(new InetSocketAddress(QUEUEPORT));

      logger.info("url 分发中心启动 ,占用端口 : " + QUEUEPORT);
    } catch (Exception e) {
      logger.error("url 分发中心启动失败  ", e);
    }
View Full Code Here

     
      queueAcceptor.setHandler(new ConversationSaveHandler()); // 处理线程
     
      queueAcceptor.getSessionConfig().setReadBufferSize(2048);
      queueAcceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10);
      queueAcceptor.bind(new InetSocketAddress(CONVERSATIONSAVEPORT));
     
      logger.info("结果保存中心启动 ,占用端口 : "+CONVERSATIONSAVEPORT);
    } catch (Exception e) {
      logger.info("结果保存中心启动失败  ",e);
    }
View Full Code Here

                sent.flip();
                session.write(sent);
            }
        });
        acceptor.setReuseAddress(true);
        acceptor.bind(new InetSocketAddress(echoPort));
        this.acceptor = acceptor;

    }

    @After
View Full Code Here

            public void messageReceived(IoSession session, Object message) throws Exception {
                session.write(IoBuffer.wrap(sb.toString().getBytes()));
            }
        });
        acceptor.setReuseAddress(true);
        acceptor.bind(new InetSocketAddress(port));


        Session session = createSession();

        final int forwardedPort1 = getFreePort();
View Full Code Here

        // set this NioSocketAcceptor's handler to the ImageServerHandler
        acceptor.setHandler(handler);
       
        // Bind to the specified address.  This kicks off the listening for
        // incoming connections
        acceptor.bind(new InetSocketAddress(PORT));
        System.out.println("Step 1 server is listenig at port " + PORT);
    }
}
View Full Code Here

        // set this NioSocketAcceptor's handler to the ImageServerHandler
        acceptor.setHandler(handler);
       
        // Bind to the specified address.  This kicks off the listening for
        // incoming connections
        acceptor.bind(new InetSocketAddress(PORT));
        System.out.println("Step 2 server is listenig at port " + PORT);
    }
}
View Full Code Here

        // set this NioSocketAcceptor's handler to the ImageServerHandler
        acceptor.setHandler(handler);
       
        // Bind to the specified address.  This kicks off the listening for
        // incoming connections
        acceptor.bind(new InetSocketAddress(PORT));
        System.out.println("Step 3 server is listenig at port " + PORT);
    }
}
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.