Package org.pokenet.server.network.codec

Examples of org.pokenet.server.network.codec.PokenetCodecFactory


       
    /*
     * Bind the TCP port
     */
    m_tcpAcceptor = new NioSocketAcceptor();
    m_tcpAcceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new PokenetCodecFactory()));
    m_tcpAcceptor.setHandler(m_tcpProtocolHandler);
    try {
      m_tcpAcceptor.bind(new InetSocketAddress(7002));
      System.out.println("INFO: TCP acceptor started.");
    } catch (Exception e) {
      e.printStackTrace();
      return;
    }
    /*
     * Bind the UDP port
     */
    m_udpAcceptor = new NioDatagramAcceptor();
    m_udpAcceptor.setHandler(m_udpProtocolHandler);
    DefaultIoFilterChainBuilder chain = m_udpAcceptor.getFilterChain();

    chain.addLast("codec", new ProtocolCodecFilter(new PokenetCodecFactory()));
    DatagramSessionConfig dcfg = m_udpAcceptor.getSessionConfig();
    dcfg.setReuseAddress(true);
    try {
      m_udpAcceptor.bind(new InetSocketAddress(7005));
      System.out.println("INFO: UDP acceptor started.");
View Full Code Here

TOP

Related Classes of org.pokenet.server.network.codec.PokenetCodecFactory

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.