Package net.jxta.protocol

Examples of net.jxta.protocol.DiscoveryResponseMsg


    }

    public void discoveryEvent(DiscoveryEvent event) {
        System.out.println("Process discovery event...");

        DiscoveryResponseMsg response = event.getResponse();

        // Get the responding peer's advertisement as a string
        String responderAdvString = response.getPeerAdv();

        //System.out.println("peer Advertisement: " + responderAdvString);
        try {
            // create a peer advertisement
            InputStream is = new ByteArrayInputStream(responderAdvString
                    .getBytes());
            PeerAdvertisement responderAdv = (PeerAdvertisement) AdvertisementFactory
                    .newAdvertisement(_XML_MIME_TYPE, is);
            System.out.println(" [  Got a Discovery Response ["
                    + response.getResponseCount() + " elements] from peer: "
                    + responderAdv.getName() + " ]");

            String peerID = (responderAdv.getPeerID()).toString();
            _resolverService.sendQuery(peerID, _actorQueryMessage);
        } catch (java.io.IOException e) {
View Full Code Here

TOP

Related Classes of net.jxta.protocol.DiscoveryResponseMsg

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.