Package com.sun.grizzly

Examples of com.sun.grizzly.UDPSelectorHandler


    }
 
 
  private UDPSelectorHandler startUDPServer(TargetTuple targetTuple,
            ProtocolChainInstanceHandler instanceHandler) {
        UDPSelectorHandler udpSelector =
                createUdpEndpoint(targetTuple.getSocketAddress());

        localUDPSocketAddress = targetTuple.getSocketAddress();

        SelectionKeyHandler keyHandler = createSelectionKeyHandler(-1);

        udpSelector.setSelectionKeyHandler(keyHandler);

        udpSelector.setProtocolChainInstanceHandler(instanceHandler);

        serverController.addSelectorHandler(udpSelector);

        return udpSelector;
    }
View Full Code Here


        return tlsSelector;
    }

    private UDPSelectorHandler startUDPClient(
            ProtocolChainInstanceHandler instanceHandler) {
        UDPSelectorHandler udpClientSelectorHandler =
                useDefaultUDPSelectorHandler
                ? new UDPSelectorHandler(true) : new ReadUDPSelectorHandler(true);

        SelectionKeyHandler keyHandler =
                createSelectionKeyHandler(keepAliveTimeoutInSeconds);

        udpClientSelectorHandler.setSelectionKeyHandler(keyHandler);

        udpClientSelectorHandler.setProtocolChainInstanceHandler(instanceHandler);

        clientController.addSelectorHandler(udpClientSelectorHandler);

        return udpClientSelectorHandler;
    }
View Full Code Here

        return selectorHandler;
    }

    UDPSelectorHandler createUdpEndpoint(InetSocketAddress addr) {
        UDPSelectorHandler selectorHandler = useDefaultUDPSelectorHandler
                ? new UDPSelectorHandler() : new ReadUDPSelectorHandler();

        selectorHandler.setPort(addr.getPort());

        selectorHandler.setInet(addr.getAddress());

        selectorHandler.setLogger(logger);

        selectorHandler.setReuseAddress(true);

        return selectorHandler;
    }
View Full Code Here

        ((DefaultPipeline) stunPipeline).setInitialByteBufferSize(4096);
        ((DefaultPipeline) stunPipeline).setByteBufferType(ByteBufferType.HEAP);
        stunPipeline.setMaxQueueSize(-1);
        stunPipeline.initPipeline();

        UDPSelectorHandler stunHandler = new UDPSelectorHandler();
        stunHandler.setPort(DEFAULT_STUN_PORT);
        try {
            stunHandler.setInet(InetAddress.getByName(DEFAULT_STUN_LISTEN_ADDRESS));
        } catch (UnknownHostException ue) {
            ue.printStackTrace();
        }
        stunHandler.setReuseAddress(true);
        stunHandler.setLogger(logger);

        ProtocolChainInstanceHandler instanceHandler =
                new SimpleProtocolChainInstanceHandler(protocolChain);

        stunController.setProtocolChainInstanceHandler(instanceHandler);
View Full Code Here

TOP

Related Classes of com.sun.grizzly.UDPSelectorHandler

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.