Examples of RelayChannel


Examples of org.xmpp.jnodes.RelayChannel

        final String namespace = element.getNamespaceURI();

        if (JingleChannelIQ.NAME.equals(element.getName()) && JingleChannelIQ.NAMESPACE.equals(namespace)
                && UDP.equals(element.attributeValue(PROTOCOL))) {
            final Element childElement = iq.getChildElement().createCopy();
            final RelayChannel channel = plugin.createRelayChannel();

            if (channel != null) {

                childElement.addAttribute(HOST, LocalIPResolver.getLocalIP());
                childElement.addAttribute(LOCAL_PORT, Integer.toString(channel.getPortA()));
                childElement.addAttribute(REMOTE_PORT, Integer.toString(channel.getPortB()));

                reply.setChildElement(childElement);

                Log.debug("Created relay channel {}:{}, {}:{}, {}:{}", new Object[]{HOST,
                        LocalIPResolver.getLocalIP(), LOCAL_PORT, Integer.toString(channel.getPortA()), REMOTE_PORT,
                        Integer.toString(channel.getPortB())});

            } else {
                reply.setError(PacketError.Condition.internal_server_error);
            }
            return reply;
View Full Code Here

Examples of org.xmpp.jnodes.RelayChannel

            removeChannel(c);
        }
    }

    public RelayChannel createRelayChannel() {
        RelayChannel rc = null;
        try {

            rc = RelayChannel.createLocalRelayChannel(bindAllInterfaces ? "0.0.0.0" : LocalIPResolver.getLocalIP(), 30000, 50000);
            final int id = ids.incrementAndGet();
            final String sId = String.valueOf(id);
            rc.setAttachment(sId);

            channels.put(sId, rc);
        } catch (IOException e) {
            Log.error("Could Not Create Channel.", e);
        }
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.