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();