Package javax.jmdns

Examples of javax.jmdns.ServiceInfo


            values.put("Pair", toHex(pair));

            byte[] name = new byte[20];
            random.nextBytes(name);
            System.out.println("Requesting pairing for " + toHex(name));
            ServiceInfo pairservice = ServiceInfo.create(REMOTE_TYPE, toHex(name), 1025, 0, 0, values);
            jmdns.registerService(pairservice);

            System.out.println("\nRegistered Service as " + pairservice);
            System.out.println("Press q and Enter, to quit");
            // int b;
View Full Code Here


    }

    public void stop() {
        if (jmdns != null) {
            for (Iterator<ServiceInfo> iter = serviceInfos.iterator(); iter.hasNext();) {
                ServiceInfo si = iter.next();
                jmdns.unregisterService(si);
            }

            // Close it down async since this could block for a while.
            final JmDNS closeTarget = jmdns;
View Full Code Here

            jmdns = null;
        }
    }

    public void registerService(String name) throws IOException {
        ServiceInfo si = createServiceInfo(name, new HashMap());
        serviceInfos.add(si);
        getJmdns().registerService(si);
    }
View Full Code Here

        String type = getType();

        if (LOG.isDebugEnabled()) {
            LOG.debug("Registering service type: " + type + " name: " + name + " details: " + map);
        }
        return new ServiceInfo(type, name + "." + type, port, weight, priority, "");
    }
View Full Code Here

    {
        logger.info("Service resolved: " + se.getName() + ", " + se.getType());
       
        try
        {
            ServiceInfo info = se.getInfo();
            logger.debug("info = " + info);

            if(info != null)
            {
                String guid = info.getPropertyString("guid");
                logger.debug("guid: " + guid);
            }


            // find out the GUID of the campaign
View Full Code Here

                        jmdns = new JmDNS();
                    }
                    String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();

                    if (clientPortNum != -1) {
                        ServiceInfo clientService = new ServiceInfo("_xmpp-client._tcp.local.",
                                serverName + "._xmpp-client._tcp.local.", clientPortNum, "XMPP Server");
                        jmdns.registerService(clientService);
                    }
                    if (componentPortNum != -1) {
                        ServiceInfo componentService = new ServiceInfo("_xmpp-component._tcp.local.",
                                serverName +  "._xmpp-component._tcp.local.", componentPortNum, "XMPP Component Server");
                        jmdns.registerService(componentService);
                    }
                }
                 catch (IOException ioe) {
View Full Code Here

            this.jmdns = JmDNS.create(); // Maybe init with local loopback in case no other network card is present, otherwise returns null

            this.timeOfStartup = System.currentTimeMillis();

            final int port = getFreePort();
            final ServiceInfo service = ServiceInfo.create(TYPE, NAME + " @" + this.timeOfStartup, port, 0, 0, EXPORT_NAME);
            this.logger.finer("Exporting at port " + port);
            this.localManagerExportServer = Proxies.newServer(EXPORT_NAME, port, (DiscoveryManager) this.localTCPIPManager);
            this.logger.finer("Announcing at port " + port);
            this.jmdns.registerService(service);
View Full Code Here

        // Ignore if Bonjour has been disabled
        if(!isActive())
            return;

        // Creates a new BonjourService corresponding to the new service and add it to the list of current Bonjour services
        ServiceInfo serviceInfo = serviceEvent.getInfo();
        if(serviceInfo!=null) {
            if(serviceInfo.getInetAddress() instanceof Inet6Address) {
                // IPv6 addresses not supported at this time + they seem not to be correctly handled by ServiceInfo
              LOGGER.debug("ignoring IPv6 service");
                return;
            }
View Full Code Here

            return;

        // Looks for an existing BonjourService instance corresponding to the service being removed and removes it from
        // the list of current Bonjour services.
        // ServiceInfo should be available in JmDNS's cache.
        ServiceInfo serviceInfo = jmDNS.getServiceInfo(serviceEvent.getType(), serviceEvent.getName());
        if(serviceInfo!=null) {
            if(serviceInfo.getInetAddress() instanceof Inet6Address) {
                // IPv6 addresses not supported at this time + they seem not to be correctly handled by ServiceInfo
              LOGGER.debug("ignoring IPv6 service");
                return;
            }
View Full Code Here

    }

    public void stop() {
        if (jmdns != null) {
            for (Iterator<ServiceInfo> iter = serviceInfos.iterator(); iter.hasNext();) {
                ServiceInfo si = iter.next();
                jmdns.unregisterService(si);
            }

            // Close it down async since this could block for a while.
            final JmDNS closeTarget = jmdns;
View Full Code Here

TOP

Related Classes of javax.jmdns.ServiceInfo

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.