Package org.cybergarage.upnp.ssdp

Examples of org.cybergarage.upnp.ssdp.SSDPNotifySocket


  }

  public void announce(String bindAddr) {
    String devLocation = getLocationURL(bindAddr);

    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);

    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setServer(UPnP.getServerName());
    ssdpReq.setLeaseTime(getLeaseTime());
    ssdpReq.setLocation(devLocation);
    ssdpReq.setNTS(NTS.ALIVE);
    ssdpReq.setBootId(getBootId());

    // uuid:device-UUID(::upnp:rootdevice)*
    if (isRootDevice() == true) {
      String devNT = getNotifyDeviceNT();
      String devUSN = getNotifyDeviceUSN();
      ssdpReq.setNT(devNT);
      ssdpReq.setUSN(devUSN);
      ssdpSock.post(ssdpReq);

      String devUDN = getUDN();
      ssdpReq.setNT(devUDN);
      ssdpReq.setUSN(devUDN);
      ssdpSock.post(ssdpReq);
    }

    // uuid:device-UUID::urn:schemas-upnp-org:device:deviceType:v
    String devNT = getNotifyDeviceTypeNT();
    String devUSN = getNotifyDeviceTypeUSN();
    ssdpReq.setNT(devNT);
    ssdpReq.setUSN(devUSN);
    ssdpSock.post(ssdpReq);

    // Thanks for Mikael Hakman (04/25/05)
    ssdpSock.close();

    ServiceList serviceList = getServiceList();
    int serviceCnt = serviceList.size();
    for (int n = 0; n < serviceCnt; n++) {
      Service service = serviceList.getService(n);
View Full Code Here


    }
  }

  public void byebye(String bindAddr) {
    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);

    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setNTS(NTS.BYEBYE);

    // uuid:device-UUID(::upnp:rootdevice)*
    if (isRootDevice() == true) {
      String devNT = getNotifyDeviceNT();
      String devUSN = getNotifyDeviceUSN();
      ssdpReq.setNT(devNT);
      ssdpReq.setUSN(devUSN);
      ssdpSock.post(ssdpReq);
    }

    // uuid:device-UUID::urn:schemas-upnp-org:device:deviceType:v
    String devNT = getNotifyDeviceTypeNT();
    String devUSN = getNotifyDeviceTypeUSN();
    ssdpReq.setNT(devNT);
    ssdpReq.setUSN(devUSN);
    ssdpSock.post(ssdpReq);

    // Thanks for Mikael Hakman (04/25/05)
    ssdpSock.close();

    ServiceList serviceList = getServiceList();
    int serviceCnt = serviceList.size();
    for (int n = 0; n < serviceCnt; n++) {
      Service service = serviceList.getService(n);
View Full Code Here

    ssdpReq.setLocation(devLocation);
    ssdpReq.setNTS(NTS.ALIVE);
    ssdpReq.setNT(serviceNT);
    ssdpReq.setUSN(serviceUSN);

    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);
    Device.notifyWait();
    ssdpSock.post(ssdpReq);
  }
View Full Code Here

    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setNTS(NTS.BYEBYE);
    ssdpReq.setNT(devNT);
    ssdpReq.setUSN(devUSN);

    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);
    Device.notifyWait();
    ssdpSock.post(ssdpReq);
  }
View Full Code Here

TOP

Related Classes of org.cybergarage.upnp.ssdp.SSDPNotifySocket

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.