Examples of IoAcceptorConfig


Examples of org.apache.mina.common.IoAcceptorConfig

    /** Set this to true if you want to make the server SSL */
    private static final boolean USE_SSL = false;

    public static void main(String[] args) throws Exception {
        IoAcceptor acceptor = new SocketAcceptor();
        IoAcceptorConfig config = new SocketAcceptorConfig();
        DefaultIoFilterChainBuilder chain = config.getFilterChain();

        // Add SSL filter if SSL is enabled.
        if (USE_SSL) {
            addSSLSupport(chain);
        }
View Full Code Here

Examples of org.apache.mina.common.IoAcceptorConfig

  {
        ByteBuffer.setUseDirectBuffers(false);
        ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
       
        IoAcceptor acceptor = new SocketAcceptor();
        IoAcceptorConfig config = new SocketAcceptorConfig();
        acceptor.bind( new InetSocketAddress(PORT), new ProfilerServerHandler(), config);
        log.info("PBLabs Profiler server started on localhost:" + PORT);
  }
View Full Code Here

Examples of org.apache.mina.common.IoAcceptorConfig

          .availableProcessors() + 1, Executors.newCachedThreadPool());
      acceptor.getFilterChain().addFirst("packetthrottler",
          PacketThrottler.getInstance());
      acceptor.getFilterChain().addFirst("connectionfilter",
          new ConnectionFilter());
      IoAcceptorConfig config = new SocketAcceptorConfig();
      config.setDisconnectOnUnbind(true);

      config.setThreadModel(ThreadModel.MANUAL);
      SocketSessionConfig ssc = (SocketSessionConfig) config
          .getSessionConfig();
      ssc.setSendBufferSize(10000);
      ssc.setReceiveBufferSize(10000);
      acceptor.bind(new InetSocketAddress(Config.SERVER_IP,
          Config.SERVER_PORT), new RSCConnectionHandler(engine),
View Full Code Here

Examples of org.apache.mina.common.IoAcceptorConfig

  }

  private IoAcceptor createListener(String ip, int port, IoHandler handler)
      throws IOException {
    final IoAcceptor acceptor = new SocketAcceptor();
    IoAcceptorConfig config = new SocketAcceptorConfig();
    config.setDisconnectOnUnbind(true);
    ((SocketSessionConfig) config.getSessionConfig()).setReuseAddress(true);
    acceptor.bind(new InetSocketAddress(ip, port), handler, config);
    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
      public void run() {
        acceptor.unbindAll();
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.